git.lucas.co / cce-designer
graphic design tool
git clone https://git.lucas.co/cce-designer.git

commit062d98298e233c5ede9af690e50ad626f767438c
parentacc38e6ca5
authorLucas Galante <lsgalante12@gmail.com>
date2026-09-30 12:16
fix: the palette's sliders read the wheel as up is more, a natural finger too

Through cce-ui's value_notches_y, as every other value control does
now; the finger tests pin natural scrolling per thread.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

 CLAUDE.md     | 13 +++++++++++++
 src/dialog.rs |  4 +++-
 src/main.rs   | 18 ++++++++++++++++++
 3 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/CLAUDE.md b/CLAUDE.md
index efb6a42..adef8f8 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -2945,6 +2945,19 @@ the alternative is calling every command to see whether it is handled, and
 argues for: a label kept in two places drifts, and a renamed one fails silently
 — the dispatch falls through its match and the command does nothing.
 
+### Scrolling a value: up is more, wheel or natural finger
+
+Every slider and spinbox the designer shows — the params pane's, the
+viewport and playbar menus', the palette's — turns by cce-ui's
+`value_notches_y` (2026-09-30; see its CLAUDE.md, "A value control reads
+the wheel as up is more"): a wheel notch up is more, and with natural
+scrolling on, the fingers going up is more too. The palette's
+`scroll_slider` reads it as the toolkit controls do. The suite pins the
+setting per test thread with `cce_ui::input::force_natural_scroll`, since
+this test binary links cce-ui without `cfg(test)` and would read the
+machine's input.kdl: `a_trackpad_swipe_over_a_spinbox_row_steps_it` drives
+a spinbox with a finger both ways.
+
 ### The dialog (Alt+D, Ctrl+P, Tab)
 
 `src/dialog.rs` is the app's one modal overlay, and **every filterable list
diff --git a/src/dialog.rs b/src/dialog.rs
index 56b2892..55852fe 100644
--- a/src/dialog.rs
+++ b/src/dialog.rs
@@ -1165,7 +1165,9 @@ impl Input for Dialog {
                         if let Some(r) = self.row_rect(rect, i) {
                             let s = self.slider_rect(r);
                             if *x >= s.x && *x < s.x + s.width {
-                                return self.scroll_slider(i, delta.notches_y());
+                                // Up is more, for a wheel and for a
+                                // finger alike (`value_notches_y`).
+                                return self.scroll_slider(i, delta.value_notches_y());
                             }
                         }
                     }
diff --git a/src/main.rs b/src/main.rs
index b8777d7..9abcefa 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -15453,6 +15453,10 @@ mod tests {
         let before = value(&state);
 
         state.handle_event(&WindowEvent::CursorMoved { position: LocalPosition { x: (x + w * 0.3) as f64, y: (y + h * 0.5) as f64 } });
+        // The designer's test binary links cce-ui without cfg(test), so the
+        // natural-scroll setting would be the MACHINE's: pinned here, both
+        // ways in turn.
+        cce_ui::input::force_natural_scroll(Some(false));
         set_scroll_phase(ScrollPhase::Finger);
         state.ui_context.scroll_gesture_new = true;
         state.ui_context.scroll_initiate_widget_id = None;
@@ -15463,6 +15467,20 @@ mod tests {
         // A mouse notch on the same row, as before.
         assert!(state.handle_event(&WindowEvent::MouseWheel { delta: MouseScrollDelta::LineDelta(0.0, -1.0) }));
         assert_eq!(value(&state), before);
+
+        // With natural scrolling on, the fingers going UP is more: the
+        // same travel, the other sign of delta.
+        cce_ui::input::force_natural_scroll(Some(true));
+        set_scroll_phase(ScrollPhase::Finger);
+        state.ui_context.scroll_gesture_new = true;
+        state.ui_context.scroll_initiate_widget_id = None;
+        assert!(state.handle_event(&WindowEvent::MouseWheel { delta: MouseScrollDelta::PixelDelta(Position { x: 0.0, y: -60.0 }) }));
+        set_scroll_phase(ScrollPhase::Wheel);
+        assert_eq!(value(&state), before + 1.0, "natural: fingers up is a step up");
+        // And a wheel notch up is still more.
+        assert!(state.handle_event(&WindowEvent::MouseWheel { delta: MouseScrollDelta::LineDelta(0.0, 1.0) }));
+        assert_eq!(value(&state), before + 2.0);
+        cce_ui::input::force_natural_scroll(None);
     }
 
     /// During playback the scene is built for the frame the playbar shows,