questions about pack / flex #3922
Replies: 2 comments 5 replies
|
Flex can be applied to all widgets, not just boxes. The "box specific" description is misleading - it should probably say "widget" or maybe "element"). Your "direction" example is an interesting one. The general rule we try to follow is that there should be a direct mapping to HTML and CSS; based on that reading, a label should expand vertically. In this case I can explain the discrepancy - that the label widget has a fixed intrinsic height (as do most widgets), and that means the widget isn't expanding to the full "flex" height. The question then becomes whether this is a bug in the Label widget, a bug in Pack, or a bug/edge case in the HTML/CSS mapping. I think the issue with dividers is #1529; the history on that ticket shows there's something complex going there that has defied analysis to date. |
|
Hi all, I keep running into (for me) unexpected flex behavior. Please consider the example below. 1: When removing the height=100 on the line indicated with 1 the yellow column disappears. It seems the column cannot figure out the height of the row it is in, although it should be clearly 100 because of the other column. Is this behavior consistent with the documentation of flex, more specifically "Once fixed space allocations have been performed, this box will assume flex / (sum of all flex for all siblings) of all remaining available space in the direction of the parent's layout." 2: The example (with the height=100) works regardless of the Column indicated with 2 in the code below. However, commenting the column changes the "direction of the parent's layout". Again, is this compatible with documentation cited above? Thanks for you consideration, |


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
1/ Does flex apply only to boxes or to all widgets?
the manual says A weighting that is used to compare this box with its siblings when allocating remaining space in a box.
2/ In the example below, the label scales to full width in the first case but does not scale to full height in the second case, although the examples are symmetric. Why? (edit: With boxes this does work as I expected. Wouldn't it make sense for all widgets with a width and hight to behave in the same way?)
3/ In the example below, the vertical divider is shown in the first and second case but not in the third. Is there any way to make a vertical divider scale to the hight of the row (determined by the other widgets, in this case the labels)?
All reactions