From 25647e6e256d2037403fa7ea3f448175ccec24c3 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 26 Nov 2026 08:36:42 -0800 Subject: [PATCH] Exercise Graph design dismissal without a captured press --- crates/ui-egui/src/dialogs/graph_design.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/crates/ui-egui/src/dialogs/graph_design.rs b/crates/ui-egui/src/dialogs/graph_design.rs index cf0c4dc6e1..348287e7bd 100644 --- a/crates/ui-egui/src/dialogs/graph_design.rs +++ b/crates/ui-egui/src/dialogs/graph_design.rs @@ -903,16 +903,14 @@ mod tests { ); h.run_steps(4); if dismiss { - let pos = h.get_by_label("OK").rect().center(); - let button = - |pressed| egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; - h.hover_at(pos); - h.event(button(true)); - h.step(); - h.input_mut().events.extend([ - button(false), - egui::Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: Default::default() }, - ]); + h.get_by_label("OK").click_accesskit(); + h.input_mut().events.push(egui::Event::Key { + key: egui::Key::Escape, + physical_key: None, + pressed: true, + repeat: false, + modifiers: Default::default(), + }); } else { h.get_by_label("OK").click(); }