Old code was not reading value properly when initial value was 1, misplacing the handle as a result.
BUG: 405471
mart | |
ngraham | |
broulik |
Plasma |
Old code was not reading value properly when initial value was 1, misplacing the handle as a result.
BUG: 405471
Tested by running qmlscene with:
import QtQuick.Controls 2.5 Slider { from: 1 to: 5 stepSize: 1 //orientation: Qt.Vertical }
Tested both in horizontal and vertical orientation.
You can also test this in the Mouse KCM, with the Pointer Speed slider.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Hmm seems to be behaving the same as before, just that the handle is now on the tickmark.
But the problem with reverse is that if I drag it right it goes left? And we see proper behavior with XDG_CURRENT_DESKTOP=QT qmlscene SliderTest.qml -reverse then?
Hm, right, seems the slider behaves incorrectly without this patch, too :/ Still I think visualPosition is what we want to be using
About Qt's unmodified slider, isn't that one wrong as well ie. shouldn't the values be reversed? So that 1 is on the right, 5 is on the left? But when we fire it up it behaves exactly the same as if there is no reverse flag.
So from my understanding our slider should fix both that and then the drag behavior once we figure that out.
So I looked up Google's documentation and it turns out sliders do have to be mirrored:
https://material.io/design/usability/bidirectionality.html#mirroring-elements
https://material.io/design/components/sliders.html#usage
As for the implementation, @broulik mentioned it would be better to use controlRoot.mirrored for mirroring and controlRoot.visualPosition for value. I couldn't come up with something that would work well, but if anyone has ideas I'll change the current code.