git.lucas.co / cce-ui
GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git

commitaa914764398b2d6e838504b3f1e032444573e98f
parent7498b7662c
authorLucas Galante <[email protected]>
date2026-08-26 14:51
breadcrumb: hit() claims only the segment run

Hosts float the breadcrumb over live content now (the designer's graph
runs underneath the strip), so the widget's hit region sharpens from its
laid-out rect to the segments themselves — presses on the strip's empty
remainder fall through to what's beneath, and the copy-path right-click
menu opens only over the run.

Co-Authored-By: Claude Fable 5 <[email protected]>

 src/widget/container/breadcrumb.rs | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/widget/container/breadcrumb.rs b/src/widget/container/breadcrumb.rs
index aa0e43c..e4175b9 100644
--- a/src/widget/container/breadcrumb.rs
+++ b/src/widget/container/breadcrumb.rs
@@ -342,6 +342,15 @@ impl Paint for Breadcrumb {
 }
 
 impl Input for Breadcrumb {
+    /// The widget claims only its segment run, not its laid-out strip: hosts
+    /// float the breadcrumb over live content (the designer's graph runs
+    /// underneath), and presses on the strip's empty remainder must fall
+    /// through to what's beneath. Right-clicks sharpen with it — the
+    /// copy-path menu opens over the run, the content's own menu elsewhere.
+    fn hit(&self, rect: Rect, px: f32, py: f32) -> bool {
+        self.seg_at(rect, px, py).is_some()
+    }
+
     fn on_event(&mut self, event: &Event, ectx: &mut EventCtx) -> bool {
         match event {
             Event::PointerMove { x: px, y: py, .. } => {