Skip to content

Conversation

ozwaldorf
Copy link
Contributor

Adds a check for ui.is_enabled() when displaying the SubMenu items. There were a few places the condition could be placed, but I figured there was simplest. The inner button will already not be able to be clicked due to ui being disabled.

cc @lucasmerlin

  • I have followed the instructions in the PR template

Copy link
Collaborator

@lucasmerlin lucasmerlin left a comment

Choose a reason for hiding this comment

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

Good catch! It'd be awesome if you could add a disabled submenu to the popups demo.

@lucasmerlin lucasmerlin added bug Something is broken egui labels Aug 8, 2025
Copy link

github-actions bot commented Aug 8, 2025

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

@ozwaldorf
Copy link
Contributor Author

@lucasmerlin It'd be awesome if you could add a disabled submenu to the popups demo.

Done!

@ozwaldorf ozwaldorf force-pushed the fix-disabled-submenu branch from 4e3a0e8 to 0767b61 Compare August 12, 2025 13:25
@ozwaldorf
Copy link
Contributor Author

Rebased onto latest main

@ozwaldorf ozwaldorf force-pushed the fix-disabled-submenu branch from 0767b61 to 93bd926 Compare August 14, 2025 14:43
@ozwaldorf
Copy link
Contributor Author

cc @emilk rebased again and fix the fmt error. Should be g2g now finally 😅

@emilk emilk merged commit 454af7a into emilk:main Aug 24, 2025
26 checks passed
@emilk emilk added this to the 0.32.2 milestone Aug 24, 2025
@ozwaldorf ozwaldorf deleted the fix-disabled-submenu branch August 24, 2025 14:04
lucasmerlin pushed a commit that referenced this pull request Sep 4, 2025
<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/main/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to test and add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

Adds a check for `ui.is_enabled()` when displaying the SubMenu items.
There were a few places the condition could be placed, but I figured
there was simplest. The inner button will already not be able to be
clicked due to ui being disabled.

cc @lucasmerlin 

* [x] I have followed the instructions in the PR template

---------

Co-authored-by: Emil Ernerfeldt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is broken egui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants