Index: sources/gui/qml/pages/treatment/sections/TreatmentFlowsComponent.qml =================================================================== diff -u -re36852d9548379bd861d4b0838761d2aa5243dad -r863764371ec0a4569403135975a0a3f44e516163 --- sources/gui/qml/pages/treatment/sections/TreatmentFlowsComponent.qml (.../TreatmentFlowsComponent.qml) (revision e36852d9548379bd861d4b0838761d2aa5243dad) +++ sources/gui/qml/pages/treatment/sections/TreatmentFlowsComponent.qml (.../TreatmentFlowsComponent.qml) (revision 863764371ec0a4569403135975a0a3f44e516163) @@ -11,29 +11,35 @@ import "qrc:/pages/treatment" Rectangle { id: _root + objectName: "_TreatmentFlowsComponent" - property string title : "" - property string value : "" - property string unitText : "" - property string extraText : "" - property alias value : _value.topText + property string title : "" + property string unitText : "" + property string extraText : "" + property alias value : _rangedValue.rawValue + property alias minimum : _rangedValue.rawMin + property alias maximum : _rangedValue.rawMax + property alias step : _rangedValue.rawStep + property alias precision : _rangedValue.precision + property bool showButtons : true + property bool buttonsEnabled : true + property bool dropShadowEnabled : true - property bool showButtons : true - property bool buttonsEnabled : true - property bool dropShadowEnabled : true - color : Colors.mainTreatmentLighterBlue radius : 5 - signal increment() - signal decrement() + signal increment(real newValue) + signal decrement(real newValue) + RangedValue { id: _rangedValue + objectName: "_rangedValue" + } + Text { id: _title objectName: "title" anchors { horizontalCenter : _root.horizontalCenter - horizontalCenterOffset : Variables.defaultMargin * 1.5 top : parent.top topMargin : Variables.defaultMargin } @@ -47,7 +53,7 @@ height : Variables.contentHeight text : _root.title color : Colors.pressuresText - horizontalAlignment : Text.AlignLeft + horizontalAlignment : Text.AlignHCenter } Row { id: _row @@ -67,7 +73,7 @@ } height : Variables.contentHeight width : Variables.treatmentFlowsComponentWidth - topText : value + topText : value !== undefined ? _root.value.toFixed(_root.precision) : Variables.emptyEntry topTextFont.pixelSize : 60 topTextFont.weight : Font.Medium bottomText : _root.unitText @@ -105,17 +111,17 @@ ArrowButton {id : _upArrowIcon objectName : "upArrowIcon" upArrow : true - enabled : buttonsEnabled + enabled : buttonsEnabled && _rangedValue.canIncrement - onClicked : _root.increment() + onClicked : { _root.increment(_rangedValue.incrementedValue()) } } ArrowButton {id : _downArrowIcon objectName : "downArrowIcon" downArrow : true - enabled : buttonsEnabled + enabled : buttonsEnabled && _rangedValue.canDecrement - onClicked : _root.decrement() + onClicked : { _root.decrement(_rangedValue.decrementedValue()) } } } }