Index: sources/gui/qml/components/Slider.qml =================================================================== diff -u -raf8d98b36b427e2b5f4d6659fcf3b58ee79eab6a -ra070e7cd1dc7dcb4ba7fc5906c195357fe95d2f9 --- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision af8d98b36b427e2b5f4d6659fcf3b58ee79eab6a) +++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision a070e7cd1dc7dcb4ba7fc5906c195357fe95d2f9) @@ -51,6 +51,43 @@ signal progressRectDragged() signal activeChanged() + function incrementValue (vInStepSegments) { + // in case the slider is not yet activated, activate + if (!isActive) { + setActive(true) + } + updateValue(vInStepSegments, true) + } + + function decrementValue (vInStepSegments) { + // in case the slider is not yet activated, activate + if (!isActive) { + setActive(true) + } + updateValue(vInStepSegments, false) + } + + function updateValue(vInStepSegments, vIsIncrement) { + let amountChanged = 1 + if (vInStepSegments) { + amountChanged = step + } + + let newValue = Number.NaN + if(vIsIncrement) { + newValue = _root.value + amountChanged + } else { + newValue = _root.value - amountChanged + } + + // Capping values based on min/max threshold + if ( newValue < minimum ) newValue = minimum + if ( newValue > maximum ) newValue = maximum + + // update new value + update(newValue.toFixed(decimal)) + } + function setActive(active) { if (active) { color = Colors.createTreatmentActive