Bug 478437 - Plasma Components Slider does not respect step size when using scroll wheel to change value.
Summary: Plasma Components Slider does not respect step size when using scroll wheel t...
Status: RESOLVED UPSTREAM
Alias: None
Product: libplasma
Classification: Frameworks and Libraries
Component: components (show other bugs)
Version: 5.246.0
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-12 15:02 UTC by Trần Nam Tuấn (Bill)
Modified: 2023-12-12 16:48 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Test QML file. (1.68 KB, text/x-qml)
2023-12-12 15:02 UTC, Trần Nam Tuấn (Bill)
Details
Demonstrate video (274.11 KB, video/mp4)
2023-12-12 15:02 UTC, Trần Nam Tuấn (Bill)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Trần Nam Tuấn (Bill) 2023-12-12 15:02:07 UTC
Created attachment 164111 [details]
Test QML file.

The Slider component does not seem to respect step size when using scroll/mouse wheel to change its value. I encounter this on my laptop with a touchpad.

The Slider is an item in a PlasmoidItem. Its value is bound to a Label to be displayed. The step size is set to an integer.
Snap mode is set to SnapAlways.

If I use my mouse click to drag the slider knob, the value is change as expected. If the mouse wheel is used, the value jumps into a non integer value.

This behavior does not exist with vanilla QQC.
Comment 1 Trần Nam Tuấn (Bill) 2023-12-12 15:02:46 UTC
Created attachment 164112 [details]
Demonstrate video
Comment 2 Trần Nam Tuấn (Bill) 2023-12-12 16:05:39 UTC
Upon looking closer at the code, Plasma Components Slider has wheelEnabled set to true by default. If I set this property to true in QQC Slider, this bug also happens.

However, If I set the property to false, scrolling using touchpad still work with QQC Slider but doesn't work with Plasma Components Slider.
Comment 3 ratijas 2023-12-12 16:30:15 UTC
See https://bugreports.qt.io/browse/QTBUG-93081
Comment 4 ratijas 2023-12-12 16:33:40 UTC
> However, If I set the property to false, scrolling using touchpad still work with QQC Slider but doesn't work with Plasma Components Slider.

Also we do have custom logic in our qqc2-desktop-style Slider.qml:
https://invent.kde.org/frameworks/qqc2-desktop-style/-/blob/f159a5d64ecd52dd3e75588759b7ce7838014bc4/org.kde.desktop/Slider.qml#L52-83

which we never ported to Plasma because it's such an ugly hack
Comment 5 Trần Nam Tuấn (Bill) 2023-12-12 16:48:48 UTC
Well then. For now, I'm just going to round the value to the nearest integer as a workaround.