Without an explicit size the layout system does not have enough
constraints to produce nice looking dialogs. Up until now the workaround
was to set explicit an size for some of the widget. This worked well
enough except when resizing down the window up until the widget size
constraints could no longer be enforced. At that point, produced layouts
looked too squished.
Some dialogs overlay the launcher's game list. However, the launcher is
not always shown and as such is not always layed out. Laying out the
dependent dialogs would fail. This problem was indroduced with the
dynamic layout system. Previously the dialogs were layed out eagerly on
theme initialization. Which is no longer possible as dialogs now need to
be initialized to be layed out.
Previously it was only possible to specify whether items where aligned
to the start or centered in the cross direction of the layouts. It is
now additionally possible to align the items to the far end of the cross
direction or to resize them to match the size of the layout.
Terminology and behavior are loosely based on CSS's flexbox containers.
Prior to this change, a GUI layout was only affected by the screen size.
Now, a layout can additionally be influenced by the GUI dialog and widgets
that uses it. This capability is leveraged to implement the following
features:
* Layout elements that are not bound to a GUI widget do not take space.
This means that dialogs where the widgets shown depend on for example
a feature being enabled at configure time no longer have blank spaces.
* Widgets can define a minimal required size for their contents not to be
cut. For now this is only used for buttons so their width is always
sufficient for their caption not to be cut. This mechanism could be
applied to other widget types in the future.
The changes in 1dce33dd9f introduced a
case where the width of widgets would not be set. This commit reverts
the offending changes and introduces a different fix for the original
issue.
Only recompute the width/height of a stack if it is not explicitly set.
Fixes#11214.
* Testing if a widget can be centered was ignoring the padding.
* Only resize a layout based on its content if it was not explicitely
sized by its parent. Fixes the logo causing incorrect layout
computations when the window width is lower than the image width.
- Split out label from PopUp widget
- Aligned every widget on all layouts so GUI becomes to look nice again
- Moved textHAlign to layout properties
svn-id: r41266