Skip to content
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

Add ComboBox::close_behavior #5305

Merged
merged 3 commits into from
Oct 29, 2024
Merged

Conversation

avalsch
Copy link
Contributor

@avalsch avalsch commented Oct 25, 2024

Exposed the underlying PopupCloseBehavior of ComboBox in order to allow more control of ComboBox behavior.

This allows ComboBox to be used rather than manually managing a popup directly, while also gaining the convenience features of ComboBox such as popup auto-sizing.

  • I have followed the instructions in the PR template

Allows changing the close behavior of the
underlying popup.

For example, to allow a ComboBox with checkboxes
to select multiple values without closing.
Added popup example to demonstrate setting
ComboBox close behavior, and slightly restructured
the rest of the example.
@emilk emilk added feature New feature or request egui labels Oct 29, 2024
Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@emilk emilk changed the title Add ComboBox::close_behavior to expose underlying PopupCloseBehavior Add ComboBox::close_behavior Oct 29, 2024
Copy link

Preview available at https://egui-pr-preview.github.io/pr/5305-combobox-close-behavior
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@emilk emilk merged commit 9891648 into emilk:master Oct 29, 2024
26 checks passed
hacknus pushed a commit to hacknus/egui that referenced this pull request Oct 30, 2024
Exposed the underlying PopupCloseBehavior of ComboBox in order to allow
more control of ComboBox behavior.

This allows ComboBox to be used rather than manually managing a popup
directly, while also gaining the convenience features of ComboBox such
as popup auto-sizing.

* [x] I have followed the instructions in the PR template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
egui feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants