Slider: snap coarse drags, default with alt+click only

I’m a bit lost with snapping sliders. I want to snap coarse drags, but not fine (ctrl+) drags, textbox input or automation. Setting an inverval with setRange snaps everything. Overriding snapValue allows to exclude automation and textbox input, but still doesn’t distinguish between coarse and fine drags. So it seems that if I allow fine tuning at all, I have to live with a coarse drag that stops anywhere. This isn’t very standard. I mean for float parameters, snapping is a visual, GUI thing. A coarse drag that falls anywhere is bad UX, but a quantized float parameter is bad DSP…

So, is there any way to snap coarse drags while still allowing fine tuning… without rewriting Slider?

Another, I guess smaller thing, has to do with setDoubleClickReturnValue. It uses alt+click and double click at the same time. The thing is that I’m implementing slider-less sliders -they’re just textboxes. If I enable editing with double click only, and also enable default with double click, a double click first defaults, then edits. So I have to enable editing with single click, and live with the lesser issue of alt+click editing after defaulting. This would be solved by letting the label catch all double clicks, and defaulting with alt+click only.

1 Like

Well, I’ll answer myself just in case I’m not the only newbie in town

  1. “Fine” drags are actually velocity drags and snapValue does distinguish them
  2. In the same Slider subclass override mouseDoubleClick with {}

Night.

1 Like