Re: Minimum height for minimum width - reprise



Il giorno mer, 19/06/2013 alle 13.40 +0900, Tristan Van Berkom ha
scritto:
On Wed, Jun 19, 2013 at 1:31 AM, Pietro Battiston <me pietrobattiston it> wrote:
[...]
If I'm honest about the minimum width, then the (corresponding) minimum
height required is assumed to be something huge, and the result (for
instance directly inside a window) is ugly.

This is the nature or height for width, minimum height for minimum width
will usually be tall and slim.

However there are a few tactics to use which ensure that tall and slim windows
don't occur.


Notice the window in my case is not tall and slim, it is tall and large!
Because the width is the natural one, but the minimal height corresponds
to the minimal width.


   a.) The toplevel window should not by default present itself at
minimum width,
        I think currently GTK+ toplevels use some trickery with natural width.

        I.e., the height of a window is not determined by the minimum
width of a window,
        it's determined by the height for the width which will be
*allocated* to the window
        (that's an important difference).


Maybe I misunderstand you, but what seems to happen is precisely that
the height of a window is "determined by the minimum width of a window":

git clone git://pietrobattiston.it/quack
cd quack
git checkout wrapbox_error
cd plugins/tags
python test_wrapbox.py


[...]

   b.) Make sure that labels do not request a ridiculously small
minimum width when they
        are set to wrap.


OK, fine - labels were just an example, I don't claim I know better than
anybody else how they should behave.



   c.) Height for width makes more sense when there are areas in your
application which
        might be smaller or larger or contain some content which might
not always be visible.
[...]

Sure.



[...]

Or in few words: am I missing anything? Taking it to the extreme, is
there actually any way to create a simple widget which always asks for
100 000 pixels of screen space, but is totally indifferent with respect
to the aspect ratio?

Of course, many widgets do this, i.e. a GtkImage loaded from a pixbuf only
requests the size of the image, and does not trade any height for width.

Actually, what I'm asking is exactly the opposite: is there any way to
create a simple widget which
1) requests (=minimal) a rectangular area of 10 000 pixels, accepting
any possible ratio going from 20 x 500 to 500 x 20
2) suggests (=natural) a 100 x 100 square
?

This is, to my eyes, the clearest example of height-for-width space
management... and as far as I understand, it is currently impossible.

Am I missing something?

Thanks again,

Pietro



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]