Bug 479879 - Keyboard brightness controls with stepped values allows scrolling in between values
Summary: Keyboard brightness controls with stepped values allows scrolling in between ...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Brightness and Color (show other bugs)
Version: 5.27.10
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-16 04:44 UTC by Antti Savolainen
Modified: 2024-02-13 20:06 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Savolainen 2024-01-16 04:44:56 UTC
SUMMARY
Demonstrative video: https://youtu.be/k41rchftoWg
If you have a backlit keyboard like the one in Thinkpad T470s, its brightness controls show up in the brightness control applet. The backlight is however stepped as in it's either off, dim or full as the brightness control shows. When dragging the slider with a mouse it works as expected but if you hover over it and use the trackpad to scroll, the slider goes to in-between values. This is purely cosmetic as it only affects the backlight when it hits one of the steps.

STEPS TO REPRODUCE
1. Have a backlit keyboard with set brightness levels
2. Open the brightness control applet
3. Hover your mouse over the keyboard brightness controls and use mouse scroll 

OBSERVED RESULT
The controls goes in-between the steps

EXPECTED RESULT
Scrolling should cause the control to hop to the next step

SOFTWARE/OS VERSIONS
Linux: Arch Linux
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.114.0
Qt Version: 5.15.12
Comment 1 fanzhuyifan 2024-01-27 16:16:19 UTC
This is a known upstream Qt issue. https://bugreports.qt.io/browse/QTBUG-93081

See also: https://codereview.qt-project.org/c/qt/qtdeclarative/+/512061
Comment 2 fanzhuyifan 2024-02-13 20:03:21 UTC
Git commit aea3d4b131070d8388edf84c9c2a32f7b4203617 by Yifan Zhu.
Committed on 13/02/2024 at 20:01.
Pushed by fanzhuyifan into branch 'master'.

Slider: Fix slider scrolling direction

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.
Related: bug 479028
FIXED-IN: 6.0

M  +38   -1    src/declarativeimports/plasmacomponents3/Slider.qml

https://invent.kde.org/plasma/libplasma/-/commit/aea3d4b131070d8388edf84c9c2a32f7b4203617
Comment 3 fanzhuyifan 2024-02-13 20:06:15 UTC
Git commit 249c56925682c478ef2b4be18cfc0b0fcefa2e92 by Yifan Zhu.
Committed on 13/02/2024 at 20:04.
Pushed by fanzhuyifan into branch 'Plasma/6.0'.

Slider: Fix slider scrolling direction

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.
Related: bug 479028
FIXED-IN: 6.0


(cherry picked from commit aea3d4b131070d8388edf84c9c2a32f7b4203617)

M  +38   -1    src/declarativeimports/plasmacomponents3/Slider.qml

https://invent.kde.org/plasma/libplasma/-/commit/249c56925682c478ef2b4be18cfc0b0fcefa2e92