Index: sources/gui/qml/components/HeaderBar.qml =================================================================== diff -u -rf0e262920199d1d5ebdbe3f1bf0c58c58a82d363 -rd4b731494a05087a763afff95b91c675bb417347 --- sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision f0e262920199d1d5ebdbe3f1bf0c58c58a82d363) +++ sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision d4b731494a05087a763afff95b91c675bb417347) @@ -9,9 +9,10 @@ property alias headerMenuIndex : _headerMenu.index property alias titleText : _title.text property alias loggedUser : _loggedInUser.text + property alias model : _model readonly property int currentScreen : _headerMenu.currentScreen - property alias statusColor : _headerMenu.statusColor property bool isCreateRx : false // set in slot in parent + property bool isHeparinFeatured : vSettings.heparinSyringePump width : Variables.applicationWidth height : Variables.headerHeight @@ -22,6 +23,23 @@ GradientStop { position: 0.8; color: Qt.darker (Colors.backgroundMain, 1.2) } } + enum TreatmentScreen { + Treatment = 0, + Trends = 1, + Heparin = 2, + HDF = 3 + } + + onIsHeparinFeaturedChanged : _model.setProperty(HeaderBar.Heparin, "visible", _root.isHeparinFeatured) + Component.onCompleted : _model.setProperty(HeaderBar.Heparin, "visible", _root.isHeparinFeatured) + + ListModel { id: _model + ListElement { text: qsTr("Treatment"); visible: true; screen: 0; statusColor: "Transparent" } // HeaderBar.Treatment + ListElement { text: qsTr("Trends"); visible: true; screen: 1; statusColor: "Transparent" } // HeaderBar.Trends + ListElement { text: qsTr("Heparin"); visible: true; screen: 2; statusColor: "Transparent" } // HeaderBar.Heparin + ListElement { text: qsTr("HDF"); visible: false; screen: 3; statusColor: "Transparent" } // HeaderBar.HDF + } + function vitalsRecorded() { _vitalsButton.pulseAnimation.start() } MouseArea { id: _mouseArea @@ -138,15 +156,7 @@ backgroundColor : Colors.transparent highlightHeight : 15 model : _model - isMainTreatment : true - onHiddenChanged: { if (hidden) { index = 0 } } - - ListModel { id: _model - ListElement { text: qsTr("Treatment"); visible: true; screen: 0 } // MainMenu.Treatment - ListElement { text: qsTr("Trends"); visible: true; screen: 1 } // MainMenu.Trends - ListElement { text: qsTr("Heparin"); visible: true; screen: 2 } // MainMenu.Heparin - ListElement { text: qsTr("HDF"); visible: false; screen: 3 } // MainMenu.HDF - } + onHiddenChanged : { if (hidden) { index = 0 } } } Row { id: _headerButtonRow Index: sources/gui/qml/components/MainMenu.qml =================================================================== diff -u -r69c86c57349b7d4a6ba47a801ba27b1c470fade5 -rd4b731494a05087a763afff95b91c675bb417347 --- sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision 69c86c57349b7d4a6ba47a801ba27b1c470fade5) +++ sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision d4b731494a05087a763afff95b91c675bb417347) @@ -33,22 +33,13 @@ property int titlePixelSize : 40 property color backgroundColor : Colors.backgroundMainMenu property int highlightHeight : 10 - property bool isMainTreatment : false - readonly property int currentScreen : isMainTreatment ? model.get(index).screen : 0 - property color statusColor : Colors.transparent + readonly property int currentScreen : model.get(index).screen ?? 0 width : parent.width height : Variables.mainMenuHeight color : _root.backgroundColor clip : true - enum TreatmentScreen { - Treatment = 0, - Trends = 1, - Heparin = 2, - HDF = 3 - } - gradient: Gradient { GradientStop { position: 0.2; color: Qt.lighter(Colors.backgroundMain, 1.2) } GradientStop { position: 0.8; color: Qt.darker (Colors.backgroundMain, 1.2) } @@ -94,7 +85,7 @@ objectName : "delegateControl" width : ListView.view.count ? _delegateControl.visible ? ListView.view.width / ListView.view.count : 0 : 0 height : ListView.view.height - visible : model.screen === MainMenu.Heparin ? vSettings.heparinSyringePump : model.visible + visible : model.visible TouchRect { id : _touchRect objectName: "_touchRect" + index @@ -104,7 +95,7 @@ border.width: 0 pixelSize : titlePixelSize - Rectangle { id: _heparinStatus + Rectangle { id: _status anchors { left : parent.left leftMargin : Variables.defaultMargin * 2 @@ -115,8 +106,7 @@ height : 15 width : height radius : height - visible : _root.isMainTreatment && model.screen === MainMenu.Heparin - color : _root.statusColor + color : model.statusColor ?? Colors.transparent } onPressed: { Index: sources/gui/qml/compounds/NumPad.qml =================================================================== diff -u -rc749ecd5dc413ce091250af652ccba4d96f7a582 -rd4b731494a05087a763afff95b91c675bb417347 --- sources/gui/qml/compounds/NumPad.qml (.../NumPad.qml) (revision c749ecd5dc413ce091250af652ccba4d96f7a582) +++ sources/gui/qml/compounds/NumPad.qml (.../NumPad.qml) (revision d4b731494a05087a763afff95b91c675bb417347) @@ -38,12 +38,10 @@ width : Variables.numPadWidth height : Variables.numPadHeight -// visible : false radius : 9 color : Colors.backgroundMain x : Math.round((Variables.applicationWidth - _root.width) / 2) y : Math.round((Variables.applicationHeight - _root.height) / 2) -// onVisibleChanged : if ( ! _root.visible ) { reset() } onDisplayValueChanged : if ( _root.setter ) { _root.setter( _valueLabel.text ) } onSettingValueChanged : _valueLabel.text = _root.settingValue !== undefined ? _root.settingValue : "" @@ -55,16 +53,6 @@ function open(entry, title, min, max, unit) { reset() setup(entry, title, min, max, unit) -// _root.settingValue = Qt.binding(function () { return entry.text }) -// _root.title = title -// _root.unit = unit -// _root.range = min.isEmpty && -// max.isEmpty ? "" : ("%1 %2 - %3") .arg(qsTr("Range:")) -// .arg(min) -// .arg(max) -// _root.getter = entry.text -// _root.setter = function (value) { entry.text = value } -// _root.validator = function (value) { { return value >= min && value <= max } } _keyboard.setVisible(false) show() } @@ -83,19 +71,17 @@ } function show() { - if ( ! _root.visible ) { _root.visible = true } if ( ! isOpened ) { x = x + _root.width isOpened = true } } - function hide( hideOnly = false ) { + function hide() { if ( isOpened ) { x = x - _root.width isOpened = false } - else if ( _root.visible && ! hideOnly ) { _root.visible = false } } function reset() { @@ -176,7 +162,7 @@ pixelSize : 65 weight : Font.DemiBold } - color : isValueValid ? "white" : "gray" + color : isValueValid ? Colors.offWhite : Colors.red text : "" } } @@ -250,7 +236,7 @@ anchors.centerIn: parent text : _keyButton.text font.pixelSize : 40 - color : enabled ? "white" : "dimgrey" + color : enabled ? Colors.offWhite : "dimgrey" } } Index: sources/gui/qml/globals/Colors.qml =================================================================== diff -u -r1164ea502e3fabdb55aa41923e0e566505f197ef -rd4b731494a05087a763afff95b91c675bb417347 --- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 1164ea502e3fabdb55aa41923e0e566505f197ef) +++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision d4b731494a05087a763afff95b91c675bb417347) @@ -94,10 +94,14 @@ readonly property color panelInvalidBorderColor : "#FFA500" readonly property color heparinPanelBorderColor         : "#CC42556B" readonly property color heparinSectionHeader            : "#384B60" - readonly property color heparinActive                   : "#429C4A" - readonly property color heparinPaused                   : "#D9A23D" - readonly property color heparinComplete                 : "#276FCD" + readonly property color statusActive : "#339D47" + readonly property color statusPaused : "#AB7107" + readonly property color statusComplete : "#60DCFF" + readonly property color statusTextActive : "#7DF393" + readonly property color statusTextPaused : "#FFB836" + readonly property color statusTextComplete : "#185E81" + readonly property color touchTextAreaTitle : "#a0b6d0" readonly property color textTextRectTitle : white 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 } Index: sources/gui/qml/pages/treatment/TreatmentSectionHeader.qml =================================================================== diff -u -rc749ecd5dc413ce091250af652ccba4d96f7a582 -rd4b731494a05087a763afff95b91c675bb417347 --- sources/gui/qml/pages/treatment/TreatmentSectionHeader.qml (.../TreatmentSectionHeader.qml) (revision c749ecd5dc413ce091250af652ccba4d96f7a582) +++ sources/gui/qml/pages/treatment/TreatmentSectionHeader.qml (.../TreatmentSectionHeader.qml) (revision d4b731494a05087a763afff95b91c675bb417347) @@ -77,7 +77,7 @@ anchors { verticalCenter : _title.verticalCenter right : parent.right - rightMargin : Variables.defaultMargin * 2 + rightMargin : Variables.defaultMargin } iconSize : 30 visible : showEdit Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -r5a505f86c26c8e1fd6d584cd53a3765c25120781 -rd4b731494a05087a763afff95b91c675bb417347 --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 5a505f86c26c8e1fd6d584cd53a3765c25120781) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision d4b731494a05087a763afff95b91c675bb417347) @@ -55,16 +55,16 @@ onHeaderMenuIndexChanged: { switch( _headerBar.currentScreen ) { - case MainMenu.Treatment: + case HeaderBar.Treatment: pop(null) // unwind stack back to main treatment break - case MainMenu.Trends: + case HeaderBar.Trends: page( _treatmentTrends ) break; - case MainMenu.Heparin: + case HeaderBar.Heparin: page( _treatmentHeparin ) break - case MainMenu.HDF: // TODO + case HeaderBar.HDF: // TODO page( _treatmentHDF ) break default: @@ -118,7 +118,7 @@ TreatmentHeparin { id: _treatmentHeparin } Connections { target: _treatmentHeparin function onIdleTimeout ( ) { - _headerBar.headerMenuIndex = MainMenu.Treatment // on heparin idle timeout go to main treatment + _headerBar.headerMenuIndex = HeaderBar.Treatment // on heparin idle timeout go to main treatment } } @@ -215,8 +215,4 @@ function onTxDialysisChanged ( vValue ) { page( _treatmentHome , vValue )} function onTxEndChanged ( vValue ) { if ( vValue ) { _endTreatmentDialog.open() }} } - - Connections { target: _mainHome - function onStartTreatment ( vValue ) { page( _treatmentHome )} - } } Index: sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml =================================================================== diff -u -rc749ecd5dc413ce091250af652ccba4d96f7a582 -rd4b731494a05087a763afff95b91c675bb417347 --- sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml (.../TreatmentSaline.qml) (revision c749ecd5dc413ce091250af652ccba4d96f7a582) +++ sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml (.../TreatmentSaline.qml) (revision d4b731494a05087a763afff95b91c675bb417347) @@ -59,9 +59,10 @@ text : isStarted ? ("%1").arg(qsTr("Delivering Fluid")) : qsTr("Total Fluid Delivered") height : Variables.contentHeight font.pixelSize : Fonts.fontPixelFluidText - font.weight : Font.Medium + font.weight : Font.Normal color : isStarted ? Colors.progressBarSaline : Colors.fluidText horizontalAlignment: Text.AlignHCenter + leftPadding : Variables.defaultMargin } Item { id: _progressBarArea