Index: sources/gui/qml/compounds/ValueAdjuster.qml =================================================================== diff -u -r9c818f9b2600fa0fb9375f5923bf01ffcbb17e0f -r5d7e02ed6481cc6ae1c944a5ba1687766f7f8375 --- sources/gui/qml/compounds/ValueAdjuster.qml (.../ValueAdjuster.qml) (revision 9c818f9b2600fa0fb9375f5923bf01ffcbb17e0f) +++ sources/gui/qml/compounds/ValueAdjuster.qml (.../ValueAdjuster.qml) (revision 5d7e02ed6481cc6ae1c944a5ba1687766f7f8375) @@ -29,17 +29,17 @@ property real actualValue : 0 property bool isActive : false property bool editable : true - property bool canAllowOff : false + property bool canOff : false property bool canRefresh : false // fix floating-point precision issue readonly property real stepVal : Math.round(step * 100) / 100 readonly property real minVal : Math.round(minimum * 100) / 100 readonly property real val : Math.round(value * 100) / 100 - readonly property bool canIncrement : isActive ? value < maximum : true - readonly property bool canDecrement : isActive ? canAllowOff ? value > 0 : - value > minimum : true + readonly property bool canIncrement : isActive ? value < maximum : true + readonly property bool canDecrement : isActive ? canOff ? value > 0 : + value > minimum : true onIsActiveChanged : { if ( canRefresh ) { canRefresh = false; return; } @@ -52,24 +52,24 @@ function clear() { _root.isActive = false } function increment() { - if ( ! isActive ) { isActive = true; return; } + if ( ! isActive ) { isActive = true; return; } - if ( canAllowOff ) { value = val < minVal ? minVal : val + stepVal } + if ( canOff ) { value = val < minVal ? minVal : val + stepVal } else { value += stepVal } } function decrement() { - if ( ! isActive ) { isActive = true; return; } + if ( ! isActive ) { isActive = true; return; } - if ( canAllowOff ) { value = val > minVal ? val - stepVal : 0 } + if ( canOff ) { value = val > minVal ? val - stepVal : 0 } else { value -= stepVal } } Text { id: _text anchors.centerIn: parent - text : _root.isActive ? _root.canAllowOff ? _root.value === 0 ? - "OFF" : - _root.value.toFixed( _root.decimal ) : + text : _root.isActive ? _root.canOff ? _root.value === 0 ? + "OFF" : + _root.value.toFixed( _root.decimal ) : _root.value.toFixed( _root.decimal ) : Variables.emptyEntry color : Colors.offWhite font.pixelSize : Fonts.fontPixelValueControl Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml =================================================================== diff -u -r9ea6aa3bf4e8c4b5ef8970a6c19ad12b5765c58d -r5d7e02ed6481cc6ae1c944a5ba1687766f7f8375 --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml (.../PreTreatmentCreateContent.qml) (revision 9ea6aa3bf4e8c4b5ef8970a6c19ad12b5765c58d) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml (.../PreTreatmentCreateContent.qml) (revision 5d7e02ed6481cc6ae1c944a5ba1687766f7f8375) @@ -328,7 +328,7 @@ defaultValue : vTreatmentRanges.heparinBolusVolumeDef actualValue : vTreatmentCreate.heparinBolusVolume decimal : Variables.heparinPrecision - canAllowOff : true + canOff : true onValueChanged : { if ( ! _heparinBolusVolume.valid ) { vTreatmentCreate.heparinBolusVolumeRejectReason = Variables.noRejectReason } vTreatmentCreate.heparinBolusVolume = value @@ -349,7 +349,7 @@ defaultValue : vTreatmentRanges.heparinDispensingRateDef actualValue : vTreatmentCreate.heparinDispensingRate decimal : Variables.heparinPrecision - canAllowOff : true + canOff : true onValueChanged : { if ( ! _heparinDispensingRate.valid ) { vTreatmentCreate.heparinDispensingRateRejectReason = Variables.noRejectReason } // set heparin time to clear when set OFF to value @@ -386,7 +386,7 @@ defaultValue : _durationControl.value actualValue : vTreatmentCreate.heparinStopTime enabled : vTreatmentCreate.heparinDispensingRate - canAllowOff : true + canOff : true onValueChanged : { if ( ! _heparinStopTime.valid ) { vTreatmentCreate.heparinStopTimeRejectReason = Variables.noRejectReason } vTreatmentCreate.heparinStopTime = value @@ -547,7 +547,7 @@ step : vTreatmentRanges.bloodPressureMeasureIntervalRes defaultValue : vTreatmentRanges.bloodPressureMeasureIntervalDef actualValue : vTreatmentCreate.bloodPressureMeasureInterval - canAllowOff : true + canOff : true onValueChanged : { if ( ! _bpMeasurementInterval.valid ) { vTreatmentCreate.bloodPressureMeasureIntervalRejectReason = Variables.noRejectReason } vTreatmentCreate.bloodPressureMeasureInterval = value