-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ComboBox menu doesn't report its actual size to its closure #4452
Milestone
Comments
5 tasks
I realise now that this might be "working as intended". If the ui would be directly set to last frame's max width, there would be no means for the menu to ever shrink if the content eventually reduces its size. I'm not really sure how to go about this. |
This is a very similar problem to: |
Closed
emilk
added a commit
that referenced
this issue
May 29, 2024
…#4570) * Closes #4452 The `ComboBox` popup has a justified layout to make selection of items easier. Thanks to [the new sizing pass logic](#4535) we don't have to know the final width in advance: ![image](https://github.com/emilk/egui/assets/1148717/53b0dda7-14c9-43be-a073-ad49865e69a6)
hacknus
pushed a commit
to hacknus/egui
that referenced
this issue
Oct 30, 2024
…emilk#4570) * Closes emilk#4452 The `ComboBox` popup has a justified layout to make selection of items easier. Thanks to [the new sizing pass logic](emilk#4535) we don't have to know the final width in advance: ![image](https://github.com/emilk/egui/assets/1148717/53b0dda7-14c9-43be-a073-ad49865e69a6)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
Consider the following code:
The combobox correctly sets the width of its menu according to
width(100.0)
.Let's add some longer content:
The menu automatically increases its size to accommodate the longer content. Nice.
Expected
The
ui
passed to the closure inshow_ui
should report its actual size, which is presumably computed from last frame content. This is useful e.g. to know the full span of the menu, should the content want to have full-span highlighting (aka rerun'sListItem
).Actual
The
ui
reflects the base, unexpended width.Workaround
Manually set the width to the desired value, which requires knowing a upper bound for the content width.
The text was updated successfully, but these errors were encountered: