egui/crates/egui_demo_lib/tests/snapshots/demos
lucasmerlin 10791cc43d
Add `Modal` and `Memory::set_modal_layer` (#5358)
* Closes #686 
* Closes #839 
* #5370 should be merged before this
* [x] I have followed the instructions in the PR template

This adds modals to egui. 
This PR
- adds a new `Modal` struct
- adds `Memory::set_modal_layer` to limit focus to a layer and above
(used by the modal struct, but could also be used by custom modal
implementations)
- adds `Memory::allows_interaction` to check if a layer is behind a
modal layer, deprecating `Layer::allows_interaction`



Current problems:
- ~When a button is focused before the modal opens, it stays focused and
you also can't hit tab to focus the next widget. Seems like focus is
"stuck" on that widget until you hit escape. This might be related to
https://github.com/emilk/egui/issues/5359~ fixed!

Possible future improvements: 
- The titlebar from `window` should be made into a separate widget and
added to the modal
- The state whether the modal is open should be stored in egui
(optionally), similar to popup and menu. Ideally before this we would
refactor popup state to unify popup and menu

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-11-28 16:52:05 +01:00
..
Bézier Curve.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Code Editor.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Code Example.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Context Menus.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Dancing Strings.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Drag and Drop.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Extra Viewport.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Font Book.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Frame.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Highlighting.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Interactive Container.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Misc Demos.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Modals.png Add `Modal` and `Memory::set_modal_layer` (#5358) 2024-11-28 16:52:05 +01:00
Multi Touch.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Painting.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Pan Zoom.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Panels.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Scrolling.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Sliders.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Strip.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Table.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Text Layout.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
TextEdit.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Tooltips.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Undo Redo.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
Window Options.png Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00