Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml =================================================================== diff -u -rb54264a622d738efdafe842942921b6840828914 -r01be103f1ea2a2c1f2748501c54466135b6089a9 --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision b54264a622d738efdafe842942921b6840828914) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 01be103f1ea2a2c1f2748501c54466135b6089a9) @@ -128,49 +128,27 @@ onReleased : vTreatmentCreate.treatmentDuration = value } -// ToDo: create a component for this, -// This is a full implementation of a CheckBox -// Switch { id: _heparinDelivery -// text: qsTr("Heparin Delivery") -// width : Variables.createTreatmentSliderWidth + 25 + Connections { target : _heparinDispensingRateSwitch + function onActiveChanged ( ) { + let mActive = _heparinDispensingRateSwitch.active + let mObject = _heparinBolusVolumeSwitch -// anchors.horizontalCenter: parent.horizontalCenter + mObject.active = mActive + mObject.enabled = mActive + } -// indicator: Rectangle { -// implicitWidth : Variables.sliderCircleDiameter * 1.7 -// implicitHeight : Variables.sliderCircleDiameter - ( Variables.progressbarHandlerBorderWidth * 2 ) -// radius : implicitHeight -// x : _heparinDelivery.leftPadding -// y : parent.height / 2 - height / 2 -// color : _heparinDelivery.checked ? Colors.backgroundButtonSelect : Colors.createTreatmentInactive -// border.color : _heparinDelivery.checked ? Colors.borderButton : Colors.createTreatmentInactive -// Rectangle { id: _handler -// property real diameter : Variables.sliderCircleDiameter + function onCheckedChanged ( ) { + let mChecked = _heparinDispensingRateSwitch.checked + let mObject = _heparinBolusVolumeSwitch -// x: _heparinDelivery.checked ? parent.width - width : 0 -// anchors.verticalCenter: parent.verticalCenter -// width : diameter -// height : diameter -// radius : diameter -// color : _heparinDelivery.checked ? Colors.highlightProgressBar : Colors.createTreatmentInactive -// border { -// width: 4 -// color: Colors.textMain -// } -// } -// } + mObject.enabled = mChecked + if ( ! mChecked ) { + mObject.checked = false + } + mObject.onCheckedChanged( ) // emit the signal + } + } -// contentItem: Text { -// enabled: _heparinDelivery.checked -// text: _heparinDelivery.text -// font: _heparinDelivery.font -// opacity: enabled ? 1.0 : 0.3 -// color : Colors.textButton -// verticalAlignment: Text.AlignVCenter -// leftPadding: _heparinDelivery.indicator.width + _heparinDelivery.spacing -// } -// } - SliderCreateTreatment { id: _heparinDispensingRate objectName : "_heparinDispensingRate" label : qsTr("Heparin Dispensing Rate") @@ -187,6 +165,8 @@ adjustable : _heparinDispensingRateSwitch.checked inActiveZero: true + // ToDo: create a component for Switch, + // This is a full implementation of a Switch Switch { id: _heparinDispensingRateSwitch property bool active: false onCheckedChanged: { @@ -255,6 +235,8 @@ adjustable : _heparinBolusVolumeSwitch.checked inActiveZero: true + // ToDo: create a component for this, + // This is a full implementation of a CheckBox Switch { id: _heparinBolusVolumeSwitch property bool active: false onCheckedChanged: { @@ -265,7 +247,6 @@ vTreatmentCreate.heparinBolusVolume = 0 _heparinBolusVolume.value = 0 _heparinBolusVolume.active = ! checked - } x : width * -1.5 @@ -274,6 +255,8 @@ height : 85 // these values are set to align the switch with slider // DEBUG: background : Rectangle { color : "white" } + enabled : false // this switch dipends on the heparin dispencing + indicator: Rectangle { implicitWidth : Variables.sliderCircleDiameter * 1.7 implicitHeight : Variables.sliderCircleDiameter - ( Variables.progressbarHandlerBorderWidth * 2 ) @@ -572,6 +555,8 @@ adjustable : _bloodPressureIntervalSwitch.checked inActiveZero: true + // ToDo: create a component for this, + // This is a full implementation of a CheckBox Switch { id: _bloodPressureIntervalSwitch property bool active: false onCheckedChanged: {