Index: sources/gui/qml/components/Slider.qml =================================================================== diff -u -r7578800a0b1b509e855e5e872798163b2b2e4b1e -r376fa09daeeca0afef2b157005cc85e9595c4c96 --- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 7578800a0b1b509e855e5e872798163b2b2e4b1e) +++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 376fa09daeeca0afef2b157005cc85e9595c4c96) @@ -26,6 +26,7 @@ RangeRect { id: _root property alias value : _progressRect.value property real displayedValue : 0 + property real initActiveValue : _root.minimum // the value to assigned upon first activation property real step : 1 property bool stepSnap : false @@ -58,18 +59,10 @@ 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) } @@ -94,7 +87,7 @@ update(newValue.toFixed(decimal)) } - function setActive(active) { + function setActiveVisuals(active) { if (active) { color = Colors.sliderHighlightColor handlerColor = Colors.createTreatmentActive @@ -105,11 +98,19 @@ } onIsActiveChanged: { - setActive(isActive) + setActiveVisuals(isActive) + + // value is assigned a different value based on active-ness of the slider + // 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 } - activeChanged() + + activeChanged() // emit } onValueChanged: { @@ -126,7 +127,7 @@ radius : _root.isRoundedEnds ? (height/2) : Variables.rangeRectRadius border.width: _root.hasBorder ? Variables.rangeRectBorderWidth : 0 - border.color: _root.isActive ? Colors.borderButton : Colors.borderDisableButton + border.color: _root.isActive ? Colors.borderButton : Colors.borderDisableButton minimum : 0 maximum : 0 Index: sources/gui/qml/globals/Colors.qml =================================================================== diff -u -r89426b2b3d45008f5e6cb19e0c7adef3a242ce36 -r376fa09daeeca0afef2b157005cc85e9595c4c96 --- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 89426b2b3d45008f5e6cb19e0c7adef3a242ce36) +++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 376fa09daeeca0afef2b157005cc85e9595c4c96) @@ -43,6 +43,7 @@ readonly property color backgroundSlider : "#195187" readonly property color sliderHighlightColor : "orange" + readonly property color sliderProgressBorderActive : "white" readonly property color backgroundUltrafiltrationButton : "#31568F" readonly property color textValueUltrafiltrationButtonFg: "#98aec2" Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml =================================================================== diff -u -r74de6c3e36568bf842648d1a9f8d5bb6949fca5b -r376fa09daeeca0afef2b157005cc85e9595c4c96 --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 74de6c3e36568bf842648d1a9f8d5bb6949fca5b) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 376fa09daeeca0afef2b157005cc85e9595c4c96) @@ -583,7 +583,6 @@ onCheckedChanged: { if ( ! active ) { active = true - checked = ! checked } vTreatmentCreate.bloodPressureMeasureInterval = 0 _bloodPressureInterval.value = 0