From 4652ad2bbcd4afafe98db36e92d41509bcf295bb Mon Sep 17 00:00:00 2001 From: tareq Date: Fri, 30 Oct 2026 12:00:47 +0100 Subject: [PATCH 1/8] Toolbar: Alt/Option-click cycles the flyout tool group. Matches InDesign/Photoshop: plain click keeps the shown tool; Alt-click advances the slot without opening the menu. --- crates/ui-egui/src/toolbar.rs | 14 ++++++++++++-- crates/ui-egui/src/toolbar/tests.rs | 29 +++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index 4c6965ffc..ea5034219 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -103,19 +103,29 @@ pub fn show(app: &mut DesignApp, ui: &mut egui::Ui) { // on the tool (egui reports releases within 0.8 s as clicks). let hold_id = egui::Id::unique(("flyout_hold", gi)); let ended_hold = resp.clicked() && ui.data_mut(|d| d.remove_temp::(hold_id)).unwrap_or(false); + // Plain click selects the shown tool; Alt/Option-click cycles the flyout + // group (InDesign / Photoshop parity with the letter-key cycle). + let alt = ui.input(|i| i.modifiers.alt); if resp.clicked() && !ended_hold { - chosen = Some(shown.id); + chosen = Some(if g.len() > 1 && alt { + let from = g.iter().position(|tl| tl.id == current).unwrap_or(0); + g[(from + 1) % g.len()].id + } else { + shown.id + }); } if !resp.is_pointer_button_down_on() { ui.data_mut(|d| d.remove::(hold_id)); } // Double-click a polygon tool: Polygon Settings. - if resp.double_clicked() && matches!(shown.id, "polygon" | "polygonFrame") { + // Alt-clicks only cycle the group: exclude them from double-click dialogs. + if resp.double_clicked() && !alt && matches!(shown.id, "polygon" | "polygonFrame") { let cur = app.session.execute("tool.polygonSettings", &json!({})).unwrap_or_default(); app.ui.dialog = Some(crate::dialogs::Dialog::new("polygonSettings", cur)); } // Double-click a transform tool: its Object › Transform dialog. if resp.double_clicked() + && !alt && let Some(cmd) = transform_dialog_of(shown.id) { crate::menus::activate(app, cmd, &Value::Null); diff --git a/crates/ui-egui/src/toolbar/tests.rs b/crates/ui-egui/src/toolbar/tests.rs index 6a8ea752c..97a3bf6c3 100644 --- a/crates/ui-egui/src/toolbar/tests.rs +++ b/crates/ui-egui/src/toolbar/tests.rs @@ -378,3 +378,32 @@ fn fill_stroke_proxy_keys() { press(&mut app, &ctx, Key::X, Modifiers::NONE); assert_eq!(app.ui.stroke_front, front, "X while typing leaves the proxy alone"); } + +/// Alt/Option-click cycles a tool group's flyout without opening the menu. +#[test] +fn alt_click_cycles_the_tool_flyout_group() { + use egui::{Event, Modifiers, PointerButton}; + use egui_kittest::kittest::Queryable; + let app = crate::DesignApp::new(designcraft_engine::Session::new(), crate::Services::default()); + let mut h = crate::test_window::open(app, vec2(1400.0, 900.0)); + h.state_mut().app.select_tool("rectangleFrame"); + h.run_steps(2); + let at = h.get_by_label("Rectangle Frame Tool (F)").rect().center(); + let alt = Modifiers { alt: true, ..Default::default() }; + let click = |h: &mut egui_kittest::Harness<'static, crate::test_window::Window>, modifiers: Modifiers| { + h.input_mut().events.push(Event::ModifiersChanged(modifiers)); + h.input_mut().events.push(Event::PointerMoved(at)); + for pressed in [true, false] { + h.input_mut().events.push(Event::PointerButton { pos: at, button: PointerButton::Primary, pressed, modifiers }); + } + h.run_steps(3); + }; + click(&mut h, Modifiers::NONE); + assert_eq!(h.state().app.session.tool_id(), "rectangleFrame"); + assert!(h.state().app.ui.flyout.is_none()); + click(&mut h, alt); + assert_eq!(h.state().app.session.tool_id(), "ellipseFrame", "Alt-click advances the frame group"); + assert!(h.state().app.ui.flyout.is_none(), "Alt-click must not open the flyout"); + click(&mut h, alt); + assert_eq!(h.state().app.session.tool_id(), "polygonFrame"); +} From 5ec44d213e503544c12d3549d89155b4fe47908a Mon Sep 17 00:00:00 2001 From: tareq Date: Fri, 30 Oct 2026 12:43:59 +0100 Subject: [PATCH 2/8] Toolbar: ignore double-click dialogs after an Alt-click. egui pairs a plain click with a prior Alt-click as a double-click; remember the previous click's Alt so polygon/transform dialogs only open for two plain clicks. --- crates/ui-egui/src/toolbar.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index ea5034219..ea7b4d287 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -106,7 +106,12 @@ pub fn show(app: &mut DesignApp, ui: &mut egui::Ui) { // Plain click selects the shown tool; Alt/Option-click cycles the flyout // group (InDesign / Photoshop parity with the letter-key cycle). let alt = ui.input(|i| i.modifiers.alt); - if resp.clicked() && !ended_hold { + // egui's double-click ignores modifiers: remember the previous click's + // Alt so dialogs only open for two plain clicks (same as PhotoCraft). + let prev_alt_id = egui::Id::unique(("tool-click-alt", gi)); + let prev_alt = ui.data(|d| d.get_temp::(prev_alt_id)).unwrap_or(false); + let slot_click = resp.clicked() && !ended_hold; + if slot_click { chosen = Some(if g.len() > 1 && alt { let from = g.iter().position(|tl| tl.id == current).unwrap_or(0); g[(from + 1) % g.len()].id @@ -119,17 +124,20 @@ pub fn show(app: &mut DesignApp, ui: &mut egui::Ui) { } // Double-click a polygon tool: Polygon Settings. // Alt-clicks only cycle the group: exclude them from double-click dialogs. - if resp.double_clicked() && !alt && matches!(shown.id, "polygon" | "polygonFrame") { + let plain_double = resp.double_clicked() && !alt && !prev_alt; + if plain_double && matches!(shown.id, "polygon" | "polygonFrame") { let cur = app.session.execute("tool.polygonSettings", &json!({})).unwrap_or_default(); app.ui.dialog = Some(crate::dialogs::Dialog::new("polygonSettings", cur)); } // Double-click a transform tool: its Object › Transform dialog. - if resp.double_clicked() - && !alt + if plain_double && let Some(cmd) = transform_dialog_of(shown.id) { crate::menus::activate(app, cmd, &Value::Null); } + if slot_click { + ui.data_mut(|d| d.insert_temp(prev_alt_id, alt)); + } let held = resp.is_pointer_button_down_on() && ui.input(|i| i.pointer.press_start_time().is_some_and(|s| i.time - s > 0.35)); if g.len() > 1 && held { From 4880b917ee53fb63941a9d4533887c2d7c746a7c Mon Sep 17 00:00:00 2001 From: tareq Date: Fri, 30 Oct 2026 13:02:19 +0100 Subject: [PATCH 3/8] Toolbar: read click modifiers from the pointer release. Prefer the primary-release event's modifiers for Alt-cycle, and suppress polygon/transform dialogs when either click of a double was modified. --- crates/ui-egui/src/toolbar.rs | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index ea7b4d287..8362d2083 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -105,11 +105,29 @@ pub fn show(app: &mut DesignApp, ui: &mut egui::Ui) { let ended_hold = resp.clicked() && ui.data_mut(|d| d.remove_temp::(hold_id)).unwrap_or(false); // Plain click selects the shown tool; Alt/Option-click cycles the flyout // group (InDesign / Photoshop parity with the letter-key cycle). - let alt = ui.input(|i| i.modifiers.alt); - // egui's double-click ignores modifiers: remember the previous click's - // Alt so dialogs only open for two plain clicks (same as PhotoCraft). - let prev_alt_id = egui::Id::unique(("tool-click-alt", gi)); - let prev_alt = ui.data(|d| d.get_temp::(prev_alt_id)).unwrap_or(false); + // Prefer the primary-release event's modifiers: Alt may already be up + // by the time this frame reads i.modifiers. + let click_mods = ui.input(|i| { + i.events + .iter() + .rev() + .find_map(|e| match e { + egui::Event::PointerButton { + button: egui::PointerButton::Primary, + pressed: false, + modifiers, + .. + } => Some(*modifiers), + _ => None, + }) + .unwrap_or(i.modifiers) + }); + let alt = click_mods.alt; + let modified = click_mods.alt || click_mods.shift || click_mods.ctrl || click_mods.command; + // egui's double-click ignores modifiers: remember whether the previous + // click was modified so dialogs only open for two plain clicks. + let prev_mod_id = egui::Id::unique(("tool-click-mod", gi)); + let prev_modified = ui.data(|d| d.get_temp::(prev_mod_id)).unwrap_or(false); let slot_click = resp.clicked() && !ended_hold; if slot_click { chosen = Some(if g.len() > 1 && alt { @@ -123,8 +141,8 @@ pub fn show(app: &mut DesignApp, ui: &mut egui::Ui) { ui.data_mut(|d| d.remove::(hold_id)); } // Double-click a polygon tool: Polygon Settings. - // Alt-clicks only cycle the group: exclude them from double-click dialogs. - let plain_double = resp.double_clicked() && !alt && !prev_alt; + // Modified clicks only cycle / select: exclude them from dialogs. + let plain_double = resp.double_clicked() && !modified && !prev_modified; if plain_double && matches!(shown.id, "polygon" | "polygonFrame") { let cur = app.session.execute("tool.polygonSettings", &json!({})).unwrap_or_default(); app.ui.dialog = Some(crate::dialogs::Dialog::new("polygonSettings", cur)); @@ -136,7 +154,7 @@ pub fn show(app: &mut DesignApp, ui: &mut egui::Ui) { crate::menus::activate(app, cmd, &Value::Null); } if slot_click { - ui.data_mut(|d| d.insert_temp(prev_alt_id, alt)); + ui.data_mut(|d| d.insert_temp(prev_mod_id, modified)); } let held = resp.is_pointer_button_down_on() && ui.input(|i| i.pointer.press_start_time().is_some_and(|s| i.time - s > 0.35)); From db4f8a4d6da05b548a1ed7447d8f42e1342c98b5 Mon Sep 17 00:00:00 2001 From: tareq Date: Fri, 30 Oct 2026 13:21:01 +0100 Subject: [PATCH 4/8] Toolbar: assert Alt-click wrap-around in the flyout cycle test. CodeRabbit nitpick: after the last group tool, the next Alt-click must return to the first and keep the flyout closed. --- crates/ui-egui/src/toolbar/tests.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/ui-egui/src/toolbar/tests.rs b/crates/ui-egui/src/toolbar/tests.rs index 97a3bf6c3..5db130f63 100644 --- a/crates/ui-egui/src/toolbar/tests.rs +++ b/crates/ui-egui/src/toolbar/tests.rs @@ -406,4 +406,7 @@ fn alt_click_cycles_the_tool_flyout_group() { assert!(h.state().app.ui.flyout.is_none(), "Alt-click must not open the flyout"); click(&mut h, alt); assert_eq!(h.state().app.session.tool_id(), "polygonFrame"); + click(&mut h, alt); + assert_eq!(h.state().app.session.tool_id(), "rectangleFrame", "Alt-click after the last group tool wraps to the first"); + assert!(h.state().app.ui.flyout.is_none(), "wrap-around Alt-click must not open the flyout"); } From 9476b39e89db970b9b3bbae5a2b4f1da68c2a836 Mon Sep 17 00:00:00 2001 From: tareq Date: Fri, 30 Oct 2026 13:56:25 +0100 Subject: [PATCH 5/8] Toolbar: bind click modifiers to the slot rect. Ignore primary releases outside this tool button so another widget cannot steer Alt-cycle or suppress dialogs; harden the Alt-click test to clear i.modifiers before release. --- crates/ui-egui/src/toolbar.rs | 5 ++++- crates/ui-egui/src/toolbar/tests.rs | 31 ++++++++++++++++++++--------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index 8362d2083..1ba172004 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -107,17 +107,20 @@ pub fn show(app: &mut DesignApp, ui: &mut egui::Ui) { // group (InDesign / Photoshop parity with the letter-key cycle). // Prefer the primary-release event's modifiers: Alt may already be up // by the time this frame reads i.modifiers. + // Only a release on this slot: the frame's event list is shared, + // so a later release elsewhere must not steer Alt-cycle / dialogs. let click_mods = ui.input(|i| { i.events .iter() .rev() .find_map(|e| match e { egui::Event::PointerButton { + pos, button: egui::PointerButton::Primary, pressed: false, modifiers, .. - } => Some(*modifiers), + } if resp.rect.contains(*pos) => Some(*modifiers), _ => None, }) .unwrap_or(i.modifiers) diff --git a/crates/ui-egui/src/toolbar/tests.rs b/crates/ui-egui/src/toolbar/tests.rs index 5db130f63..5551ba2dd 100644 --- a/crates/ui-egui/src/toolbar/tests.rs +++ b/crates/ui-egui/src/toolbar/tests.rs @@ -390,23 +390,36 @@ fn alt_click_cycles_the_tool_flyout_group() { h.run_steps(2); let at = h.get_by_label("Rectangle Frame Tool (F)").rect().center(); let alt = Modifiers { alt: true, ..Default::default() }; - let click = |h: &mut egui_kittest::Harness<'static, crate::test_window::Window>, modifiers: Modifiers| { - h.input_mut().events.push(Event::ModifiersChanged(modifiers)); + // Clear i.modifiers before the release while keeping Alt on the release event, so a + // regression that only reads i.modifiers (and ignores the pointer-release modifiers) fails. + let click = |h: &mut egui_kittest::Harness<'static, crate::test_window::Window>, press_modifiers: Modifiers, current_modifiers: Modifiers| { + h.input_mut().events.push(Event::ModifiersChanged(press_modifiers)); h.input_mut().events.push(Event::PointerMoved(at)); - for pressed in [true, false] { - h.input_mut().events.push(Event::PointerButton { pos: at, button: PointerButton::Primary, pressed, modifiers }); - } + h.input_mut().events.push(Event::PointerButton { + pos: at, + button: PointerButton::Primary, + pressed: true, + modifiers: press_modifiers, + }); + h.input_mut().events.push(Event::ModifiersChanged(current_modifiers)); + h.input_mut().events.push(Event::PointerButton { + pos: at, + button: PointerButton::Primary, + pressed: false, + modifiers: press_modifiers, + }); h.run_steps(3); }; - click(&mut h, Modifiers::NONE); + click(&mut h, Modifiers::NONE, Modifiers::NONE); assert_eq!(h.state().app.session.tool_id(), "rectangleFrame"); assert!(h.state().app.ui.flyout.is_none()); - click(&mut h, alt); + click(&mut h, alt, Modifiers::NONE); assert_eq!(h.state().app.session.tool_id(), "ellipseFrame", "Alt-click advances the frame group"); assert!(h.state().app.ui.flyout.is_none(), "Alt-click must not open the flyout"); - click(&mut h, alt); + click(&mut h, alt, Modifiers::NONE); assert_eq!(h.state().app.session.tool_id(), "polygonFrame"); - click(&mut h, alt); + assert!(h.state().app.ui.dialog.is_none(), "modified double-click must not open a dialog"); + click(&mut h, alt, Modifiers::NONE); assert_eq!(h.state().app.session.tool_id(), "rectangleFrame", "Alt-click after the last group tool wraps to the first"); assert!(h.state().app.ui.flyout.is_none(), "wrap-around Alt-click must not open the flyout"); } From 00604b74f27a84ebcb0d8d0c1af37977de0bb95c Mon Sep 17 00:00:00 2001 From: tareq Date: Fri, 30 Oct 2026 14:31:53 +0100 Subject: [PATCH 6/8] Toolbar: accept slot releases that drift outside the button. egui still counts a click when the pointer leaves the tool rect; keep the release modifiers when the press started on the slot. The Alt-cycle test now uses 1 ms frames so an Alt-then-plain pair is a real double-click that must not open Polygon Settings. --- crates/ui-egui/src/toolbar.rs | 8 +++++--- crates/ui-egui/src/toolbar/tests.rs | 20 ++++++++++++++++++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index 1ba172004..de06cc26c 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -107,9 +107,11 @@ pub fn show(app: &mut DesignApp, ui: &mut egui::Ui) { // group (InDesign / Photoshop parity with the letter-key cycle). // Prefer the primary-release event's modifiers: Alt may already be up // by the time this frame reads i.modifiers. - // Only a release on this slot: the frame's event list is shared, - // so a later release elsewhere must not steer Alt-cycle / dialogs. + // Prefer a release on this slot; egui still counts a click when the + // pointer drifts a little outside, so also accept a release whose + // press started here. Ignore releases whose press was elsewhere. let click_mods = ui.input(|i| { + let press_here = i.pointer.press_origin().is_some_and(|o| resp.rect.contains(o)); i.events .iter() .rev() @@ -120,7 +122,7 @@ pub fn show(app: &mut DesignApp, ui: &mut egui::Ui) { pressed: false, modifiers, .. - } if resp.rect.contains(*pos) => Some(*modifiers), + } if resp.rect.contains(*pos) || press_here => Some(*modifiers), _ => None, }) .unwrap_or(i.modifiers) diff --git a/crates/ui-egui/src/toolbar/tests.rs b/crates/ui-egui/src/toolbar/tests.rs index 5551ba2dd..899f4855b 100644 --- a/crates/ui-egui/src/toolbar/tests.rs +++ b/crates/ui-egui/src/toolbar/tests.rs @@ -385,7 +385,9 @@ fn alt_click_cycles_the_tool_flyout_group() { use egui::{Event, Modifiers, PointerButton}; use egui_kittest::kittest::Queryable; let app = crate::DesignApp::new(designcraft_engine::Session::new(), crate::Services::default()); - let mut h = crate::test_window::open(app, vec2(1400.0, 900.0)); + // 1 ms frames so an Alt-click and a following plain click can form a real double-click + // (default open() spaces frames by 0.25 s, outside egui's double-click window). + let mut h = crate::test_window::open_stepped(app, vec2(1400.0, 900.0), 1.0, 0.001); h.state_mut().app.select_tool("rectangleFrame"); h.run_steps(2); let at = h.get_by_label("Rectangle Frame Tool (F)").rect().center(); @@ -410,16 +412,30 @@ fn alt_click_cycles_the_tool_flyout_group() { }); h.run_steps(3); }; + // Break the double-click window between independent clicks (~0.4 s at 1 ms/step). + let settle = |h: &mut egui_kittest::Harness<'static, crate::test_window::Window>| h.run_steps(400); click(&mut h, Modifiers::NONE, Modifiers::NONE); assert_eq!(h.state().app.session.tool_id(), "rectangleFrame"); assert!(h.state().app.ui.flyout.is_none()); + settle(&mut h); click(&mut h, alt, Modifiers::NONE); assert_eq!(h.state().app.session.tool_id(), "ellipseFrame", "Alt-click advances the frame group"); assert!(h.state().app.ui.flyout.is_none(), "Alt-click must not open the flyout"); + settle(&mut h); click(&mut h, alt, Modifiers::NONE); assert_eq!(h.state().app.session.tool_id(), "polygonFrame"); - assert!(h.state().app.ui.dialog.is_none(), "modified double-click must not open a dialog"); + settle(&mut h); click(&mut h, alt, Modifiers::NONE); assert_eq!(h.state().app.session.tool_id(), "rectangleFrame", "Alt-click after the last group tool wraps to the first"); assert!(h.state().app.ui.flyout.is_none(), "wrap-around Alt-click must not open the flyout"); + settle(&mut h); + // Alt-click onto polygonFrame, then a plain click inside the double-click window: egui + // reports double_clicked, but prev_modified must keep Polygon Settings closed. + h.state_mut().app.select_tool("ellipseFrame"); + h.run_steps(2); + click(&mut h, alt, Modifiers::NONE); + assert_eq!(h.state().app.session.tool_id(), "polygonFrame"); + click(&mut h, Modifiers::NONE, Modifiers::NONE); + assert!(h.state().app.ui.dialog.is_none(), "plain click after Alt-click must not open Polygon Settings"); + assert_eq!(h.state().app.session.tool_id(), "polygonFrame"); } From dbdf034cb0e7163e3b18d9616d0c5858708d221d Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sat, 31 Oct 2026 00:49:25 -0400 Subject: [PATCH 7/8] Toolbar: merge the flyout click comments into one Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/toolbar.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index de06cc26c..cf16fdcb3 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -104,12 +104,11 @@ pub fn show(app: &mut DesignApp, ui: &mut egui::Ui) { let hold_id = egui::Id::unique(("flyout_hold", gi)); let ended_hold = resp.clicked() && ui.data_mut(|d| d.remove_temp::(hold_id)).unwrap_or(false); // Plain click selects the shown tool; Alt/Option-click cycles the flyout - // group (InDesign / Photoshop parity with the letter-key cycle). - // Prefer the primary-release event's modifiers: Alt may already be up - // by the time this frame reads i.modifiers. - // Prefer a release on this slot; egui still counts a click when the - // pointer drifts a little outside, so also accept a release whose - // press started here. Ignore releases whose press was elsewhere. + // group, as the letter-key cycle does. Read the modifiers from the + // primary-release event (Alt may already be up by the time this frame + // reads i.modifiers), preferring a release on this slot; egui still + // counts a click when the pointer drifts a little outside, so a release + // whose press started here counts too, and one pressed elsewhere doesn't. let click_mods = ui.input(|i| { let press_here = i.pointer.press_origin().is_some_and(|o| resp.rect.contains(o)); i.events From 61687039eceb45a854afa885b304189325e73787 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sat, 31 Oct 2026 00:51:03 -0400 Subject: [PATCH 8/8] Toolbar: rustfmt Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/toolbar.rs | 4 +--- crates/ui-egui/src/toolbar/tests.rs | 14 ++------------ 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index cf16fdcb3..ec5b6f67b 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -152,9 +152,7 @@ pub fn show(app: &mut DesignApp, ui: &mut egui::Ui) { app.ui.dialog = Some(crate::dialogs::Dialog::new("polygonSettings", cur)); } // Double-click a transform tool: its Object › Transform dialog. - if plain_double - && let Some(cmd) = transform_dialog_of(shown.id) - { + if plain_double && let Some(cmd) = transform_dialog_of(shown.id) { crate::menus::activate(app, cmd, &Value::Null); } if slot_click { diff --git a/crates/ui-egui/src/toolbar/tests.rs b/crates/ui-egui/src/toolbar/tests.rs index 899f4855b..7a0948817 100644 --- a/crates/ui-egui/src/toolbar/tests.rs +++ b/crates/ui-egui/src/toolbar/tests.rs @@ -397,19 +397,9 @@ fn alt_click_cycles_the_tool_flyout_group() { let click = |h: &mut egui_kittest::Harness<'static, crate::test_window::Window>, press_modifiers: Modifiers, current_modifiers: Modifiers| { h.input_mut().events.push(Event::ModifiersChanged(press_modifiers)); h.input_mut().events.push(Event::PointerMoved(at)); - h.input_mut().events.push(Event::PointerButton { - pos: at, - button: PointerButton::Primary, - pressed: true, - modifiers: press_modifiers, - }); + h.input_mut().events.push(Event::PointerButton { pos: at, button: PointerButton::Primary, pressed: true, modifiers: press_modifiers }); h.input_mut().events.push(Event::ModifiersChanged(current_modifiers)); - h.input_mut().events.push(Event::PointerButton { - pos: at, - button: PointerButton::Primary, - pressed: false, - modifiers: press_modifiers, - }); + h.input_mut().events.push(Event::PointerButton { pos: at, button: PointerButton::Primary, pressed: false, modifiers: press_modifiers }); h.run_steps(3); }; // Break the double-click window between independent clicks (~0.4 s at 1 ms/step).