Skip to content

🍒 Slider: Fix slider scrolling direction

Yifan Zhu requested to merge work/cherry-pick-aea3d4b1 into Plasma/6.0

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 Slider.qml and 5d6d74ef68889da7400cb2a16a73527f1927424d in qqc2-desktop-style.

BUG: 479028 BUG: 479879 FIXED-IN: 6.0

(cherry picked from commit aea3d4b1)

Merge request reports