[Tickit-dev] H/VBox running out of space

Tom Molesworth tom at entitymodel.com
Wed Jun 15 18:18:11 BST 2011


On 15/06/11 17:42, Paul LeoNerd Evans wrote:
> The current behaviour of HBox and VBox when given a window smaller than
> the minimum size requirements of its children is analogous to that when
> it's bigger; the shortfall in columns/rows is distributed among the
> child widgets in proportion to the 'expand' setting given by each. If
> there's still a shortfall, widgets from the right/bottom start being
> truncated or omitted altogether.
>
> I'm wondering - is this sufficient? Should there be more intelligent
> behaviours in place? Perhaps in such circumstances as an HBox being used
> to implement a status bar, some widgets could be deemed less important
> than others; to be omitted entirely if this then gives the remaining a
> full allocation of size.
>
> What might the API for this look like? Is it sufficiently useful to put
> in the plain HBox/VBox, or would a more custom "StatusBar" widget be
> better for this one?

I like the idea of putting this in the generic container (HBox/VBox or
maybe even the parent LinearContainerWidget class), having a single
priority setting along with minimum sizes on the widgets should give
graceful degradation as the window is resized - could end up with no
widgets at all if the container window is smaller than the minimum
allowed for the highest priority entry, although I don't think that's
necessarily a problem. So yes, something along the lines of  ->add($y,
expand => 0.5, priority => 1); on HBox/VBox widgets would be a great
addition imho.

cheers,

Tom



More information about the Tickit-dev mailing list