Index: sources/gui/qml/pages/treatment/TreatmentHeparin.qml =================================================================== diff -u -rc369e34e8864b8b7a7bca07b77f5d3a41701ffbf -rd4b731494a05087a763afff95b91c675bb417347 --- sources/gui/qml/pages/treatment/TreatmentHeparin.qml (.../TreatmentHeparin.qml) (revision c369e34e8864b8b7a7bca07b77f5d3a41701ffbf) +++ sources/gui/qml/pages/treatment/TreatmentHeparin.qml (.../TreatmentHeparin.qml) (revision d4b731494a05087a763afff95b91c675bb417347) @@ -5,7 +5,7 @@ * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * - * \file BaseComboBox.qml + * \file TreatmentHeparin.qml * \author (last) Nico Ramirez * \date (last) 2-Dec-2025 * \author (original) Nico Ramirez @@ -38,10 +38,7 @@ readonly property bool isRejected : vTreatmentAdjustmentHeparin.adjustment_Accepted readonly property bool isTxRunning : vTDTreatmentStates.txDialysis - readonly property color heparinColor : _root.deliveryOff ? Colors.transparent : - isDispensing ? Colors.heparinActive : - isPaused ? Colors.heparinPaused : - isCompleted ? Colors.heparinComplete : Colors.transparent + readonly property bool deliveryOff : vTreatmentCreate.heparinDispensingRate === 0 readonly property string buttonText : isDispensing ? qsTr("Pause") : isPaused ? qsTr("Resume") : qsTr("Pause") @@ -60,7 +57,14 @@ signal idleTimeout() - onHeparinColorChanged : _headerBar.statusColor = heparinColor + function statusColor ( vHeaderBar = false ) { + return deliveryOff ? Colors.transparent : + isDispensing ? Colors.statusActive : + isPaused ? Colors.statusPaused : + isCompleted ? vHeaderBar ? Colors.statusComplete : + Colors.statusTextComplete : + Colors.transparent + } enum HeparinPrescription{ HeparinType, @@ -99,6 +103,12 @@ } } + Connections { target: vTDTreatmentStates + function onHeparinChanged ( vValue ) { + _headerBar.model.setProperty(HeaderBar.Heparin, "statusColor", _root.statusColor(true).toString()) + } + } + IdleTimer {id: _idleTimer anchors.fill : parent @@ -210,7 +220,7 @@ width : 100 height : 30 radius : height - color : _root.heparinColor + color : statusColor() Text { id: _statusText anchors.centerIn: parent text : _root.statusText @@ -246,7 +256,7 @@ left : parent.left } text : _root.deliveryOff ? ("%1 : %2").arg(Variables.emptyEntry).arg(Variables.emptyEntry) : _root.timeRemaining - color : _root.deliveryOff ? Colors.white : _root.isPaused ? Colors.heparinPaused : Colors.white + color : _root.deliveryOff ? Colors.white : _root.isPaused ? Colors.statusPaused : Colors.white font.pixelSize : _root.deliveryOff ? Fonts.fontPixelHeparin : Fonts.fontPixelHeparinTime font.weight : Font.DemiBold } @@ -295,7 +305,7 @@ maximum : _root.deliveryOff ? 0 : _root.target value : _root.deliveryOff ? 0 : _root.cumulative unitText : Variables.unitTextFluid - color : _root.isPaused ? Colors.heparinPaused : Colors.progressBarUltrafiltration + color : _root.isPaused ? Colors.statusPaused : Colors.progressBarUltrafiltration radius : height showMarker : false progress.opacity: _root.isPaused ? 0.5 : 1 @@ -320,7 +330,7 @@ } text : ("%1 %2").arg(_root.deliveryOff ? Variables.emptyEntry : _root.cumulative.toFixed(Variables.heparinDeliveryPrecision)).arg(qsTr(Variables.unitTextFluid)) - color : _root.deliveryOff ? Colors.white : _root.isPaused ? Colors.heparinPaused : Colors.white + color : _root.deliveryOff ? Colors.white : _root.isPaused ? Colors.statusPaused : Colors.white font.pixelSize : Fonts.fontPixelHeparin font.weight : Font.DemiBold }