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

commit9ee9c5680a33250bedc7e95533f3496098e39655
parent0da111cd81
authorLucas Galante <[email protected]>
date2026-07-30 12:48
fix: band slider accepts scrolls spatially — no gesture-initiator gate

The initiator gate rejected any wheel event whose gesture began outside
the slider, no matter where the pointer is now. Trackpad swipes are one
long gesture (kinetic tail included), so scrolling onto the band mid-swipe
— or within the 250ms gesture window of ANY prior scroll — silently did
nothing: the 'slider won't take my scroll' feel. Band style now recognizes
purely by position (anywhere in the shape halo adjusts, claiming the
gesture); the default style keeps the gate.

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

 src/widget/input/slider.rs | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/widget/input/slider.rs b/src/widget/input/slider.rs
index a228cc2..1c4f6b9 100644
--- a/src/widget/input/slider.rs
+++ b/src/widget/input/slider.rs
@@ -628,14 +628,22 @@ impl Input for Slider {
                 if !self.scroll_enabled {
                     return false;
                 }
-                // Scroll-gesture gating: only the widget that initiated the gesture keeps it.
                 if let Some(ui) = ectx.ui.as_deref_mut() {
-                    if !ui.scroll_gesture_new && ui.scroll_initiate_widget_id != Some(ectx.id) {
+                    // Band style: recognition is purely SPATIAL — anywhere in
+                    // the shape halo adjusts, mid-gesture included. Trackpad
+                    // swipes are one long gesture (kinetic tail included), so
+                    // the initiator gate below would reject every event whose
+                    // gesture began outside the halo no matter where the
+                    // pointer is now — the "slider won't take my scroll" feel.
+                    // The default style keeps the gate: only the widget that
+                    // initiated a gesture keeps it.
+                    let band = crate::layout::slider_band();
+                    if !band && !ui.scroll_gesture_new && ui.scroll_initiate_widget_id != Some(ectx.id) {
                         return false;
                     }
                     let r = ectx.rect;
                     if self.scroll_hit(r, *px, *py) {
-                        if ui.scroll_gesture_new {
+                        if band || ui.scroll_gesture_new {
                             ui.scroll_initiate_widget_id = Some(ectx.id);
                         }
                         let scroll_amount = match delta {