Closed bolshoytoster closed 1 year ago
Hi! This is intended behavior, because root widget is Canvas
. Canvas
has infinite bounds and allows setting arbitrary positions for widgets. Because of infinite bounds, there's no way to set alignments - it simply has no meaning in this case. Standard approach to make alignment work is to create a Grid
widget and set its width and height explicitly to match application window bounds. Since it has well known size, alignment will work as intended.
Root must be Canvas
, just because every UI's windows/popup can be dragged and positioned at arbitrary positions.
@mrDIMAS fair enough, i'll check out the grids.
I'm not sure if this is intended behaviour, but root widgets (no parents) ignore
horizontal_alignment
andvertical_alignment
.To modify an example from the book:
Even though alignment is set to Bottom Right:
The button still appears in the top-left, since it has no parent to align itself with.
I think, in this situation, it should be aligned by with whole screen (i.e. the example it would be in the bottom right).