Skip to content

Add ComboBox::close_behavior - #5305

Merged
emilk merged 3 commits into
emilk:masterfrom
avalsch:combobox-close-behavior
Oct 29, 2024
Merged

emilk merged 3 commits into
emilk:masterfrom
avalsch:combobox-close-behavior

Conversation

@avalsch

@avalsch avalsch commented Oct 25, 2024

Copy link
Copy Markdown
Contributor

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

@emilk emilk left a comment

Copy link
Copy Markdown
Owner

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
@github-actions

Copy link
Copy Markdown

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
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
@philocalyst

Copy link
Copy Markdown

This is my friends PR and I am leaving this comment here because I love OSS and think it's cool when people step up to the plate to contribute, it brings joy!

:) @avalsch

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.

3 participants