You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using ui.vertical_centered, it is impossible to stack multiple instances of the vertical group horizontally because each group seems to allocate all available horizontal space, even if the widget does not take up that much horizontal space. This causes the second vertical group to be ran off-screen and makes it hard to implement more complex layouts.
To Reproduce
Steps to reproduce the behavior:
Run the following program. A window similar to the first screenshot should appear.
Change ui.vertical_centered to ui.vertical and rerun. A window similar to the second screenshot should appear.
Expected behavior
Screenshots
Here is the behavior of ui.vertical_centered. Notice how the label for "B" is all the way to the right and partially offscreen.
Here is the behavior of ui.vertical. This is the behavior that I would expect vertical_centered to also do (or, if not that, at least have both A and B appear on screen).
Desktop (please complete the following information):
OS: MacOS, Monterrey 12.6
Version
egui Version: latest commit on master (at time of writing, this is commit 59c2c4c Additional context
I do not think this is an issue with the label itself requesting too much space, since similar behavior happens when creating buttons or spinners. Also, if this isn't a bug but instead intended behavior, then I think this behavior should be more clearly documented, since it seems like ui.vertical_centered_justified should do what this ui.vertical_centered currently does.
The text was updated successfully, but these errors were encountered:
Both ui.horizontal_centered() and ui.vertical_centered() need to be in an area with known height or width, respectively.
My guess would be that the layout needs to know where it ends to know where its center is.
If you know what the minimum size of the contents will be, put each ui.vertical_centered() inside ui.allocate_ui() (or any other method that pre-allocates some size for you). The vertical_centered layout will expand to fit the allocated area and will center inside this area.
Describe the bug
When using
ui.vertical_centered
, it is impossible to stack multiple instances of the vertical group horizontally because each group seems to allocate all available horizontal space, even if the widget does not take up that much horizontal space. This causes the second vertical group to be ran off-screen and makes it hard to implement more complex layouts.To Reproduce
Steps to reproduce the behavior:
ui.vertical_centered
toui.vertical
and rerun. A window similar to the second screenshot should appear.Expected behavior
Screenshots
![Image showing the behavior of vertical_centered. The B text is all the way to the right, partially offscreen.](https://user-images.githubusercontent.com/15718048/225453678-65fa6c0a-b331-4ce4-aec0-d607ea3198a3.png)
Here is the behavior of
ui.vertical_centered
. Notice how the label for "B" is all the way to the right and partially offscreen.Here is the behavior of
![Image showing the behavior of vertical. The A and B text are next to each other.](https://user-images.githubusercontent.com/15718048/225453551-40e25354-3378-47cd-badd-25e0e8c605de.png)
ui.vertical
. This is the behavior that I would expectvertical_centered
to also do (or, if not that, at least have both A and B appear on screen).Desktop (please complete the following information):
Additional context
I do not think this is an issue with the label itself requesting too much space, since similar behavior happens when creating buttons or spinners. Also, if this isn't a bug but instead intended behavior, then I think this behavior should be more clearly documented, since it seems like
ui.vertical_centered_justified
should do what thisui.vertical_centered
currently does.The text was updated successfully, but these errors were encountered: