Index: resources/images/chevron-left.png =================================================================== diff -u -rf813d68fd04134b788273466fbf754b8996b4ac2 -r4bba3aba944dd3a5461796e4f7a31d166dca42e0 Binary files differ Index: resources/images/chevron-right.png =================================================================== diff -u -rf813d68fd04134b788273466fbf754b8996b4ac2 -r4bba3aba944dd3a5461796e4f7a31d166dca42e0 Binary files differ 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 Index: sources/gui/qml/components/SliderCreateTreatment.qml =================================================================== diff -u -rb72d5c0a794796139351ac79747e00d658bad620 -r4bba3aba944dd3a5461796e4f7a31d166dca42e0 --- sources/gui/qml/components/SliderCreateTreatment.qml (.../SliderCreateTreatment.qml) (revision b72d5c0a794796139351ac79747e00d658bad620) +++ sources/gui/qml/components/SliderCreateTreatment.qml (.../SliderCreateTreatment.qml) (revision 4bba3aba944dd3a5461796e4f7a31d166dca42e0) @@ -42,14 +42,15 @@ property bool active : false property bool valid : true + property alias showAdjustButtons : _sliderArrows.visible property bool isUsingDisplayValue : true // indicate whether using the slider's actual value or displayedValue signal pressed () signal released() height : Variables.createTreatmentSliderHeight width : Variables.createTreatmentSliderWidth - color : "transparent" + color : Colors.transparent anchors.horizontalCenter: parent.horizontalCenter @@ -124,4 +125,20 @@ onReleased : { setInteractive(true ) ; _root.released( ) ; } onHandleSelected : { setActiveValid(); } } + + SliderArrows{ id:_sliderArrows + visible : true + anchors.verticalCenter : _slider.verticalCenter + anchors.left : _slider.right + anchors.leftMargin : Variables.sliderAdjustButtonLeftMargin + + onIncrementValue : { + setActiveValid() + _slider.incrementValue(true) + } + onDecrementValue : { + setActiveValid() + _slider.decrementValue(true) + } + } }