Skip to content

Fix #485: the mouse wheel steps the focused numeric field - #497

Merged
bflatastic merged 1 commit into
mainfrom
fix/issue-485
Oct 8, 2026
Merged

bflatastic merged 1 commit into
mainfrom
fix/issue-485

Conversation

@bflatastic

Copy link
Copy Markdown
Member

The wheel did nothing over numeric fields; as in Illustrator, once a numeric field has the focus, turning the wheel over it now steps its value like Up/Down.

  • One code path (widgets::step_value, formerly step_with_arrows from Panel number fields: Up/Down arrows step the value (Shift ×10, Ctrl ÷10) #357): arrows and wheel step num_field, plain_field/mixed_field and the spin fields built on them (panels, Control bar, dialogs, the Font Size / Leading combo boxes from Fix #458: Font Size and Leading combo boxes in the Character and Properties panels and the Control bar #459), and now opt_field (Stroke dash/gap) too. A notch is one step, Shift ten, Ctrl/Cmd a tenth; trackpad and fine-wheel points add up to notches. The new value is applied at once and selected.
  • No hijacking: only a focused field under the pointer takes the wheel, and the panel under it then stays put; an unfocused field, or the pointer anywhere else (panel, canvas), scrolls/zooms as before.
  • Dialogs and Preferences: their egui DragValues become the same recessed number fields (widgets::range_field: clamped to their range and rounded to their precision), so they type, step and scroll like the rest (Effect gamma, the generic command/effect/plug-in parameters, Layer and Layers Panel Options, PNG/JPEG/GIF and Save for Web counts, export options, numeric preferences).
  • Docs (docs/control-protocol.md ui.wheel), ROADMAP (Last updated, the number-field bullet). No new UI strings.

Illustrator reference: values in panels and dialogs step with the arrow keys once the field is clicked (Set precise property values); the wheel steps a field the same way after it is clicked (black-box behaviour; helpx doesn't mention the wheel).

Checks

  • Rebased on d9fc3b6505bb185c7ecce05ab4b60b86da12822f (origin/main).
  • cargo fmt --all --check; cargo clippy -p vectorcraft-ui-egui --all-targets -- -D warnings: clean.
  • cargo test -p vectorcraft-ui-egui: 714 passed. New: the_wheel_steps_a_focused_field_under_the_pointer (lines, Shift/Ctrl, points carried over, unfocused and pointer-elsewhere do nothing, plain fields) and the_wheel_scrolls_the_panel_unless_over_the_focused_field (a ScrollArea scrolls over an unfocused field, stays put over the focused one). Both fail on main.
  • cargo xtask layers, cargo xtask brands, cargo xtask wasm: OK; cargo check -p vectorcraft-ui-egui --target x86_64-unknown-linux-gnu / aarch64-apple-darwin: OK.
  • Live (desktop app, control port ui.wheel/ui.click/ui.screenshot): Control bar W: wheel over it unfocused → unchanged; clicked, +1 notch → 35.2778 → 36.278 mm, Shift +2 → 56.278, Ctrl −1 → 56.178 (value selected); the wheel over the canvas with the field focused leaves the value alone. Preferences › Smart Guides › Snapping Tolerance (a former drag value): clicked, +2 notches → 4 pt → 6 pt (dialog cancelled).

🤖 Generated with Claude Code

The wheel did nothing over numeric fields. As in Illustrator, once a numeric
field has the focus, turning the wheel over it steps its value like Up/Down:
a notch a step, Shift ten, Ctrl/Cmd a tenth, applied at once with the new value
selected.

- widgets::step_value (was step_with_arrows) reads the arrows and the wheel
  through one path for num_field, plain/mixed fields and the spin fields built
  on them (panels, the Control bar, dialogs, the Font Size and Leading combo
  boxes), and now opt_field (Stroke dash/gap) too. Trackpad and fine-wheel
  points add up to notches; the rest carries to the next turn.
- While the pointer is over the focused field the panel under it doesn't
  scroll; an unfocused field, or the pointer anywhere else, leaves the wheel to
  the panel and the canvas as before.
- The dialogs' and preferences' egui drag values become the same recessed
  number fields (widgets::range_field: clamped to their range, rounded to their
  precision), so they type, step and scroll like every other numeric field.
- Headless tests for the wheel (units, modifiers, points, focus and pointer),
  and for the panel scrolling or not; docs/control-protocol.md and ROADMAP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bflatastic
bflatastic merged commit 6641ffd into main Oct 8, 2026
@bflatastic

Copy link
Copy Markdown
Member Author

Full cargo xtask ci passed on the integrated stack; merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant