Allow popups within popups
- Dominant language
- Rust
- Stars
- 30.6k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 72
Description
- related to #5758
- and #7409
- https://github.com/emilk/egui/discussions/4463
Should we store popup state per layer instead of per viewport?
This should allow having popups-in-popups.
Popups would register itself as child/sub layers of the buttons layer.
On clicks a popup would only close if the click was clicked_elsewhere for itself and any of it's child layers.
This would also fix the bug where popups can suddenly be behind their parents layer.
To ensure that there is never more than a single "root popup", we close the popups on all layers that aren't parent layers of the opening popup.
For this we would need to change child layers a bit though:
- allow child layers with different Order than their parent
- OR popups are always on the same Order as their parent (I think I actually prefer this)
- allow multiple levels of sub layer nesting
Contributor guide
Research direction
Start by reading the related issues #5758 and #7409 and the discussion at #4463 to understand the existing popup and layer behavior. Define the nesting and ordering design, then verify that nested popups close only when clicks are outside their own and child layers while unrelated root popups close.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100