mirror of
https://github.com/storytold/designcraft.git
synced 2026-10-25 10:46:50 -06:00
Integration: Numbering & Section Options keeps Enter and Escape for an open popup
#342's Numbering & Section Options draws its OK and Cancel beside the options and reads Enter and Escape there, before the footer that #325's update guards. The same popup_open guard applies to those checks, so Enter and Escape in an open menu or name field go to the popup.
This commit is contained in:
@@ -1208,10 +1208,10 @@ pub fn show(app: &mut DesignApp, ctx: &egui::Context) {
|
||||
if let Some(ok) = crate::section_options::actions(app, &mut actions) {
|
||||
result = Some(ok);
|
||||
}
|
||||
if ui.input(|i| i.key_pressed(egui::Key::Enter)) {
|
||||
if !popup_open && ui.input(|i| i.key_pressed(egui::Key::Enter)) {
|
||||
result = Some(true);
|
||||
}
|
||||
if ui.input(|i| i.key_pressed(egui::Key::Escape)) {
|
||||
if !popup_open && ui.input(|i| i.key_pressed(egui::Key::Escape)) {
|
||||
result = Some(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user