Index: sources/gui/qml/components/Slider.qml =================================================================== diff -u -r6d612c93d9a38fde3fadc93766976b401cf76652 -r4bba3aba944dd3a5461796e4f7a31d166dca42e0 --- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 6d612c93d9a38fde3fadc93766976b401cf76652) +++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 4bba3aba944dd3a5461796e4f7a31d166dca42e0) @@ -52,6 +52,43 @@ signal activeChanged() signal handleSelected() + 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