mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 16:59:43 +01:00
Exercise Graph design dismissal without a captured press
This commit is contained in:
1 parent
a67e603944
commit
25647e6e25
1 file changed
+8
-10
@@ -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();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user