egui/crates
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
..
ecolor Create gray -> grey doc aliases (#5362) 2024-11-11 13:21:58 +01:00
eframe document justification for FallbackEgl (#5392) 2024-11-26 15:23:43 +01:00
egui Add `Modal` and `Memory::set_modal_layer` (#5358) 2024-11-28 16:52:05 +01:00
egui-wgpu Update some crates (#5337) 2024-11-01 13:07:01 +01:00
egui-winit Update accesskit to 0.17 (#5372) 2024-11-26 15:16:08 +01:00
egui_demo_app wgpu: Bump to wgpu 23.0.0 and wasm-bindgen to 0.2.95 (#5330) 2024-10-30 18:53:22 +01:00
egui_demo_lib Add `Modal` and `Memory::set_modal_layer` (#5358) 2024-11-28 16:52:05 +01:00
egui_extras Use proper `image` crate URI and MIME support detection (#5324) 2024-11-01 13:33:12 +01:00
egui_glow Update glow to 0.16 (#5395) 2024-11-26 21:00:34 +01:00
egui_kittest Update accesskit to 0.17 (#5372) 2024-11-26 15:16:08 +01:00
egui_plot Move `egui_plot` to its own repo (#4828) 2024-07-15 18:45:19 +02:00
egui_web Fix typos (#2866) 2023-04-18 15:52:45 +02:00
emath Update ScrollArea drag velocity when drag stopped (#5175) 2024-10-02 18:12:36 +02:00
epaint Create gray -> grey doc aliases (#5362) 2024-11-11 13:21:58 +01:00
epaint_default_fonts Release 0.29.1 - Bug fixes 2024-10-01 10:08:21 +02:00