Skip to content

Slider: Fix slider scrolling direction

Yifan Zhu requested to merge work/fanzhuyifan/slider into master

We always want the slider to increase its value when scrolling up or right, no matter the inverted scrolling setting.

For "regular" scrolling, this corresponds to positive values on the Y axis and negative values on the X axis. For "natural" scrolling (indicated by the inverted property) is the opposite so we need to reverse the sign.

Note that the Qt documentation on WheelEvent is dubious: On https://doc.qt.io/qt-5/qml-qtquick-wheelevent.html, the angleDelta section suggests that positive should be up/right, but the inverted section indicates the above mentioned behavior.

This commit borrows from See Slider.qml and 5d6d74ef68889da7400cb2a16a73527f1927424d in qqc2-desktop-style.

BUG: 479028 BUG: 479879 FIXED-IN: 6.0

I used grep -C1000 -i 'plasma.components' **/*.qml | grep 'Slider {' to find all users of this component, and none had custom wheel handling code.

Edited by Yifan Zhu

Merge request reports