From 8331defed54eb14a168d80eeda11b8b1216dbdc3 Mon Sep 17 00:00:00 2001 From: aiongg Date: Thu, 12 Nov 2026 00:26:49 +0000 Subject: [PATCH] Blur Gallery pins leave a Cmd press to the host and report it as ignored_press The pins are a canvas control (a component with parts in the canvas body), not a CanvasTool: their presses never pass through the ToolHost, so ToolAction::Ignored can't carry this one. The output reports the press with the same ToolPointer that ToolHostResponse::ignored_press uses, for the app's tool. --- crates/imaging/src/ui/blur_pins/overlay.rs | 15 ++++++++--- crates/imaging/tests/it/blur_pins.rs | 30 +++++++++++++++++++--- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/crates/imaging/src/ui/blur_pins/overlay.rs b/crates/imaging/src/ui/blur_pins/overlay.rs index 5e044e046..b918c83ae 100644 --- a/crates/imaging/src/ui/blur_pins/overlay.rs +++ b/crates/imaging/src/ui/blur_pins/overlay.rs @@ -6,7 +6,7 @@ use craft_behavior::kurbo::Point; use craft_behavior::{ CanvasView, Granularity, HitLevel, HitPriority, HitShape, Intent, NavShape, PartKey, PartRef, PointerButton, PressPhase, Roving, Sense, }; -use craft_ui::canvas::canvas_space; +use craft_ui::canvas::{ToolPointer, canvas_space}; use craft_ui::contract::{ Access, Bind, BindMut, Common, Component, Cx, Edit as _, EditResponse, Focus as _, MeasureCx, Name, Numeric, Outcome, PaintUi, PartsCx, Pointer as _, Props as _, Remember as _, Role, WordSetCx as _, @@ -205,7 +205,8 @@ fn marks(pins: &BlurPins, view: &CanvasView, reach: &PinReach, canvas: Rect) -> /// - A press on a pin selects it and a drag moves it; a press on the selected pin's ring turns its amount, and on a /// handle or a Tilt-Shift line shapes it. A press on the canvas outside the pins adds a pin and drags it /// (Tilt-Shift has one band and adds none). A press that moves is one gesture; a click that only adds or selects -/// is a set. Escape cancels the drag. +/// is a set. Escape cancels the drag. A press with Cmd (Ctrl) held is the host's: the pins change nothing and report +/// it as [`BlurPinsOutput::ignored_press`], for the app's tool. /// - The pins are one Tab stop. Page Up and Page Down select the previous or next pin, the arrow keys move it one /// document pixel (Shift ten) and Delete or Backspace remove it. [`BlurPinsCommand::AddPin`] adds a pin at the /// middle of the bounds. @@ -216,12 +217,13 @@ pub struct BlurPinsOverlay<'a> { #[common] common: Common, pins: Bind<'a, BlurPins>, + ignored_press: Option, } impl<'a> BlurPinsOverlay<'a> { /// The pins named `label` over `pins`. pub fn new(label: impl Into