Index: sources/gui/qml/pages/treatment/sections/TreatmentFlowsComponent.qml =================================================================== diff -u -re36852d9548379bd861d4b0838761d2aa5243dad -rc749ecd5dc413ce091250af652ccba4d96f7a582 --- sources/gui/qml/pages/treatment/sections/TreatmentFlowsComponent.qml (.../TreatmentFlowsComponent.qml) (revision e36852d9548379bd861d4b0838761d2aa5243dad) +++ sources/gui/qml/pages/treatment/sections/TreatmentFlowsComponent.qml (.../TreatmentFlowsComponent.qml) (revision c749ecd5dc413ce091250af652ccba4d96f7a582) @@ -11,43 +11,49 @@ 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 } font { - pixelSize : 28 - weight : Font.Normal + pixelSize : Fonts.fontPixelContainerTitle + weight : Font.Medium } width : _root.width height : Variables.contentHeight text : _root.title color : Colors.pressuresText - horizontalAlignment : Text.AlignLeft + horizontalAlignment : Text.AlignHCenter } Row { id: _row @@ -67,9 +73,9 @@ } 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 + topTextFont.weight : Font.Light bottomText : _root.unitText bottomTextFont.pixelSize: 22 bottomTextTopMargin : Variables.defaultMargin @@ -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()) } } } }