Re: Minimum height for minimum width



On Tue, 2010-10-12 at 10:21 -0400, Havoc Pennington wrote:
> I guess to me it's much better to have one hack in GtkWindow globally
> (GtkWindow is already a giant special case) than to leak the hack into
> all widgets that actually do h-for-w. Just a separation of concerns
> thing. It doesn't make sense for N child widgets inside a window to
> all be trying to heuristically guess how to make the window have a
> nice aspect ratio.

I see what you're saying and it makes sense to me.

However I wouldn't say there is that much heuristic guesswork involved
in GtkLabel, only a rule of thumb: don't have a small minimum width
if its going to result in a huge height-for-minimum-width (i.e. its
not like the label is counting its siblings in the hierarchy and
doing something proportional to the current window size, or anything
really all that scary at all).

>  Just do that on the toplevel. Even if the GtkWindow
> hack is really nasty like a binary search, that's fine. (I think a
> binary search might be overkill... picking a default size assuming
> there's a roughly linear relation between min W x H-for-min-W and nat
> W x H-for-nat-W probably works fine and is only 3 request cycles and
> only to pick default size, not on every resize)
> 
> Then when implementing widgets, just return min size = min useful,
> natural size = max useful, that is the raw data for GtkWindow, no
> guesses.

And currently the "min useful" is just not defined as 
"a single word width".

Anyway, currently we have nothing at all in place that guesses
the default size - I'm not at all against adding code along 
those lines (just for the record, there's no need for any alarm
as far as I can see, please).

Cheers,
       -Tristan




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