Index: sources/gui/qml/components/Slider.qml =================================================================== diff -u -rb07e8c91cabe64f9bc29b3653d27083b5cf96cb5 -r9ac163d4aeadc39a1bcd1d8110991f32e37fc806 --- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision b07e8c91cabe64f9bc29b3653d27083b5cf96cb5) +++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 9ac163d4aeadc39a1bcd1d8110991f32e37fc806) @@ -67,6 +67,8 @@ } function updateValue(vInStepSegments, vIsIncrement) { + _root.isActive = true + let amountChanged = 1 if (vInStepSegments) { amountChanged = step @@ -104,11 +106,7 @@ // This is to resolve the use of slider with a switch and arrows enabled. // It allows correct behavior when using arrow on a first initialize increment of // the slider when the slider has inActiveZero to true. - if (!isActive) { - value = inActiveZero ? 0 : minimum - } else { - value = initActiveValue - } + value = (inActiveZero && (!isActive)) ? 0 : initActiveValue activeChanged() // emit } @@ -231,12 +229,13 @@ lineTickMarkThickness : _root.tickMarksThickness isTickMarkRound : _root.isRoundedEnds yDisplacement : _root.isRoundedEnds ? (-_handler.height/2 - _handler.border.width/2) : 0 - color: _root.isActive ? Colors.borderButton : Colors.borderDisableButton + color : _root.isActive ? Colors.borderButton : Colors.borderDisableButton } } ProgressRect { id: _progressRect property real previousSliderValue: Number.NaN + value : (inActiveZero && (!isActive)) ? 0 : initActiveValue color : Colors.sliderHighlightColor decimal : _root.decimal minimum : _root.minimum @@ -292,11 +291,15 @@ _root.isActive = true } - // On initial press without release, the value is updated to reflect the current - // pressed position, effectively moving the handle to the location without snapping + // On a pressed action, if the snapped version of the new value is the same as the + // current snapped value, do nothing; otherwise update the value to stay under + // the cursor until a release action happens to update to new snapped value let adjustedXPosition = vMouseEvent.x - _progressRect.leftRightTouchMargin let newCurrentValue = calculateValue(adjustedXPosition, !stepSnapOnRelease) - update(newCurrentValue) + let roundedNewNumber = calculateRoundedValue(newCurrentValue) + if(roundedNewNumber != _progressRect.value){ + update(newCurrentValue) + } } onReleased: { // Need to account for the extended touch areas