Index: sources/gui/qml/components/RangeSlider.qml =================================================================== diff -u -r89426b2b3d45008f5e6cb19e0c7adef3a242ce36 -r74de6c3e36568bf842648d1a9f8d5bb6949fca5b --- sources/gui/qml/components/RangeSlider.qml (.../RangeSlider.qml) (revision 89426b2b3d45008f5e6cb19e0c7adef3a242ce36) +++ sources/gui/qml/components/RangeSlider.qml (.../RangeSlider.qml) (revision 74de6c3e36568bf842648d1a9f8d5bb6949fca5b) @@ -88,7 +88,7 @@ clip : false color: Colors.transparent - height : Variables.progressbarHeight + height : Variables.sliderDefaultBodyHeight touchMargin : 25 leftRightTouchMargin: _root.diameter / 2 Index: sources/gui/qml/components/Slider.qml =================================================================== diff -u -r475b176cf3e05488c5c38e0e0e7f1bad1017ed1d -r74de6c3e36568bf842648d1a9f8d5bb6949fca5b --- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 475b176cf3e05488c5c38e0e0e7f1bad1017ed1d) +++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 74de6c3e36568bf842648d1a9f8d5bb6949fca5b) @@ -119,7 +119,7 @@ } } - height : Variables.progressbarHeight + height : Variables.sliderDefaultBodyHeight touchMargin : 25 leftRightTouchMargin: _handler.width/2 @@ -163,7 +163,7 @@ } function update(vValue) { - _root.value = Number(vValue).toFixed(decimal) + _root.value = vValue } function calculateValue(x, isSnappingToTicks) { @@ -186,8 +186,6 @@ if ( ! stepSnap ) start = mMinimum - mValue = getValueOfX(x) - // special handling for the case that the step segments are less than the handle's width let stepWidth = width / ((mMaximum - mMinimum) / step) if ( stepWidth < _handler.width ) { @@ -196,18 +194,21 @@ return mValue.toFixed(decimal) } - if ( isSnappingToTicks ) { - mValue = Math.round((mValue - start) / step) * step + start - let additionalDecimalResolution = 3 - mValue = mValue.toFixed(decimal + additionalDecimalResolution) + // calculate the expected value based on x + mValue = getValueOfX(x) - } - // For sliders with decimal min, max, values, we need to add refinement to // the value to achieve slider handle movement close to those of the whole number sliders if ( decimal > 0 ) { + let additionalDecimalResolution = 3 + mValue = mValue.toFixed(decimal + additionalDecimalResolution) } + if ( isSnappingToTicks ) { + mValue = Math.round((mValue - start) / step) * step + start + mValue = mValue.toFixed(decimal) + } + if ( mValue < mMinimum ) { return mMinimum; } if ( mValue > mMaximum ) { return mMaximum; } return mValue; Index: sources/gui/qml/components/SliderCreateTreatment.qml =================================================================== diff -u -r89426b2b3d45008f5e6cb19e0c7adef3a242ce36 -r74de6c3e36568bf842648d1a9f8d5bb6949fca5b --- sources/gui/qml/components/SliderCreateTreatment.qml (.../SliderCreateTreatment.qml) (revision 89426b2b3d45008f5e6cb19e0c7adef3a242ce36) +++ sources/gui/qml/components/SliderCreateTreatment.qml (.../SliderCreateTreatment.qml) (revision 74de6c3e36568bf842648d1a9f8d5bb6949fca5b) @@ -112,7 +112,7 @@ anchors.horizontalCenter: parent.horizontalCenter anchors.bottom : parent.bottom width : Variables.createTreatmentSliderWidth - height : Variables.createTreatmentSliderBodyHeight + height : Variables.sliderDefaultBodyHeight diameter : Variables.sliderCircleDiameter touchMargin : Variables.createTreatmentSliderMargin handlerColor : Colors.createTreatmentInactive Index: sources/gui/qml/globals/Variables.qml =================================================================== diff -u -rcc9d7bbec68ebc656ca626f47fd6f515f7cc3757 -r74de6c3e36568bf842648d1a9f8d5bb6949fca5b --- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision cc9d7bbec68ebc656ca626f47fd6f515f7cc3757) +++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 74de6c3e36568bf842648d1a9f8d5bb6949fca5b) @@ -118,8 +118,7 @@ readonly property int createTreatmentTableMargin : 20 readonly property int createTreatmentSubTableHeight : 50 readonly property int createTreatmentSubTableWidth : 500 - readonly property int createTreatmentSliderBodyHeight : 15 - readonly property int createTreatmentSliderMargin : createTreatmentSliderBodyHeight + readonly property int createTreatmentSliderMargin : sliderDefaultBodyHeight readonly property int createTreatmentSliderHeight : 65 readonly property int createTreatmentSliderWidth : 750 readonly property int createTreatmentSwitchYDisplacement : 15 @@ -128,7 +127,7 @@ readonly property int ultrafiltrationAdjustmtenOptionWidth : 520 readonly property int ultrafiltrationAdjustmtenOptionHeight : 275 readonly property int ultraFiltrationProgressBarHeight : 30 - readonly property int ultraFiltrationEditSliderHeight : createTreatmentSliderBodyHeight // to be consistent with other sliders + readonly property int ultraFiltrationEditSliderHeight : sliderDefaultBodyHeight // to be consistent with other sliders readonly property int silenceIconMargin : 10 readonly property int notificationBarIconMargin : 10 @@ -179,6 +178,7 @@ readonly property int sliderAdjustButtonLeftMargin : 30 readonly property real sliderDefaultRoundTickMarkDiameter : 5 + readonly property int sliderDefaultBodyHeight : 15 readonly property int circleButtonDefaultDiameter : 45 Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml =================================================================== diff -u -r89426b2b3d45008f5e6cb19e0c7adef3a242ce36 -r74de6c3e36568bf842648d1a9f8d5bb6949fca5b --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 89426b2b3d45008f5e6cb19e0c7adef3a242ce36) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 74de6c3e36568bf842648d1a9f8d5bb6949fca5b) @@ -417,7 +417,7 @@ RangeSlider { id: _arterialPressureLimits objectName : "_arterialPressureLimitsSlider" // dimension - height : Variables.createTreatmentSliderBodyHeight + height : Variables.sliderDefaultBodyHeight width : Variables.createTreatmentSliderWidth diameter : Variables.sliderCircleDiameter anchors.horizontalCenter: parent.horizontalCenter @@ -503,7 +503,7 @@ RangeSlider { id: _venousPressureLimits objectName: "_venousPressureLimitsSlider" // dimension - height : Variables.createTreatmentSliderBodyHeight + height : Variables.sliderDefaultBodyHeight width : Variables.createTreatmentSliderWidth diameter : Variables.sliderCircleDiameter anchors.horizontalCenter: parent.horizontalCenter