Index: leahi.qrc =================================================================== diff -u -rc843f1d6a805119ecadfa2c24f309f77e7637830 -r477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2 --- leahi.qrc (.../leahi.qrc) (revision c843f1d6a805119ecadfa2c24f309f77e7637830) +++ leahi.qrc (.../leahi.qrc) (revision 477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2) @@ -173,6 +173,8 @@ sources/gui/qml/compounds/TouchGrid.qml sources/gui/qml/compounds/BPHREntry.qml sources/gui/qml/compounds/NumPad.qml + sources/gui/qml/compounds/LabelUnitContainer.qml + sources/gui/qml/compounds/ValueAdjuster.qml qtquickcontrols2.conf Index: sources/gui/qml/components/CloseButton.qml =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2 --- sources/gui/qml/components/CloseButton.qml (.../CloseButton.qml) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/gui/qml/components/CloseButton.qml (.../CloseButton.qml) (revision 477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2) @@ -29,7 +29,7 @@ anchors { top : parent.top - left : parent.left + right : parent.right margins : 35 } Image { id : _image Index: sources/gui/qml/components/TextEntry.qml =================================================================== diff -u -rc1d0546e2d1a51ff919b2172ce647003359f0853 -r477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2 --- sources/gui/qml/components/TextEntry.qml (.../TextEntry.qml) (revision c1d0546e2d1a51ff919b2172ce647003359f0853) +++ sources/gui/qml/components/TextEntry.qml (.../TextEntry.qml) (revision 477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2) @@ -37,6 +37,7 @@ property bool hasCursor : true property alias lengthMax : _input.maximumLength property bool useQtNumPad : true + property bool showPlaceHolderText: false readonly property alias isValid : _input.acceptableInput @@ -108,6 +109,17 @@ onFocusChanged : doFocus(focus) } + Text { id: _placeHolderText + text : Variables.emptyEntry + anchors.centerIn : _input + horizontalAlignment : Text.AlignRight + font.pixelSize : Fonts.fontPixelValueControl + color : Colors.offWhite + visible : _input.text.length === 0 && + ! _input.activeFocus && + _root.showPlaceHolderText + } + Line { id : _line visible : hasCursor color : Colors.borderButtonHalfDarker Index: sources/gui/qml/components/TouchRect.qml =================================================================== diff -u -rddd2197b24223c540a016e3256f97082f817c088 -r477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2 --- sources/gui/qml/components/TouchRect.qml (.../TouchRect.qml) (revision ddd2197b24223c540a016e3256f97082f817c088) +++ sources/gui/qml/components/TouchRect.qml (.../TouchRect.qml) (revision 477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2) @@ -135,7 +135,7 @@ enabled : _root.touchable anchors.fill : parent anchors.margins : touchExpanding * -1 - onClicked : { if ( ! _private.clickDebouncing ) { onMouseEventLog("Clicked ") ; _root.clicked (); clickDebounceTimer.start(); } } + onClicked : { if ( ! _private.clickDebouncing ) { onMouseEventLog("Clicked ") ; _root.clicked (); clickDebounceTimer.start(); } focus = true; } onPressed : { if ( ! _private.pressDebouncing ) { onMouseEventLog("Pressed ") ; _private.pressed = true ; _root.pressed (); pressDebounceTimer.start(); } } onReleased : { if ( _private.pressed ) { onMouseEventLog("Released ") ; _private.pressed = false; _root.released (); pressDebounceTimer.start(); } } onPressAndHold : { onMouseEventLog("PressAndHold ") ; _root.pressAndHold(); } Index: sources/gui/qml/compounds/BPHREntry.qml =================================================================== diff -u -r23121e17d1a6120ae4a31930e18de362d9533bcb -r477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2 --- sources/gui/qml/compounds/BPHREntry.qml (.../BPHREntry.qml) (revision 23121e17d1a6120ae4a31930e18de362d9533bcb) +++ sources/gui/qml/compounds/BPHREntry.qml (.../BPHREntry.qml) (revision 477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2) @@ -27,106 +27,129 @@ * bussy circle or check mark as done. */ Item { id: _root - property int labelWidth : 200 - property int unitWidth : 100 - property int entryWidth : 100 - property int titleIndent : 25 - property int topMarginContent : 200 - property int contentRectHeight : 0 - - property alias firstInput : _bloodPressureSystolic - property alias systolic : _bloodPressureSystolic.text property alias diastolic : _bloodPressureDiastolic.text property alias heartRate : _heartRate.text + readonly property int controlWidth : width - Variables.defaultMargin * 4 + readonly property int controlHeight : 75 + readonly property bool isValid : _bloodPressureSystolic .isValid && _bloodPressureDiastolic .isValid && _heartRate .isValid && _private.isBloodPressureCompareValid + && _bpMeasurementIntervalControl.isActive - width : _container.width - height : _container.height + width : _container.width + height : _container.height + anchors.fill: parent - function setFocus(vShowKeyboard) { - if(vShowKeyboard) { - firstInput.textInput.forceActiveFocus() - _keyboard.setVisible(false) - numPad.show() - } - } - QtObject { id: _private property bool isBloodPressureCompareValid : (parseInt(_bloodPressureDiastolic.text) <= parseInt(_bloodPressureSystolic.text)) } - anchors.fill: parent - Column { id: _container - spacing : 50 - leftPadding : _root.titleIndent - anchors.centerIn: parent - Row { - spacing : 10 - TextEntry { id : _bloodPressureSystolic - text : Variables.notSetVariable(vTreatmentVitals.systolic, 0) - label.text : qsTr("Blood Pressure") - label.width : _root.labelWidth - validator : IntValidator { bottom: vTreatmentVitals.systolicMin; top : vTreatmentVitals.systolicMax } - nextInput : _bloodPressureDiastolic - textInput.color: (textInput.acceptableInput && _private.isBloodPressureCompareValid) ? Colors.textMain : Colors.red - useQtNumPad : false + spacing : 15 + leftPadding : Variables.defaultMargin * 2 + anchors.fill : parent - onClicked : numPad.open ( _bloodPressureSystolic, - qsTr("Systolic"), - vTreatmentVitals.systolicMin, - vTreatmentVitals.systolicMax, - Variables.unitTextBloodPressure) - } - Label { - text : "/" - width : 10 - } - TextEntry { id : _bloodPressureDiastolic - text : Variables.notSetVariable(vTreatmentVitals.diastolic, 0) - label.width : 0 - validator : IntValidator { bottom: vTreatmentVitals.diastolicMin; top : vTreatmentVitals.diastolicMax } - nextInput : _heartRate - textInput.color: (textInput.acceptableInput && _private.isBloodPressureCompareValid) ? Colors.textMain : Colors.red - useQtNumPad : false + LabelUnitContainer { id: _bpContainer + text : qsTr("Blood Pressure") + unitText : Variables.unitTextBloodPressure + width : _root.controlWidth + height : _root.controlHeight - onClicked : numPad.open ( _bloodPressureDiastolic, - qsTr("Diastolic"), - vTreatmentVitals.diastolicMin, - _bloodPressureSystolic.textInput.acceptableInput && - _bloodPressureSystolic.text < vTreatmentVitals.diastolicMax ? _bloodPressureSystolic.text : - vTreatmentVitals.diastolicMax, - Variables.unitTextBloodPressure) + contentItem : Row { + spacing : 10 + anchors.centerIn: parent + + TextEntry { id : _bloodPressureSystolic + text : Variables.notSetVariable(vTreatmentVitals.systolic, 0) + textInput.font.pixelSize: Fonts.fontPixelValueControl + line.visible : false + validator : IntValidator { bottom: vTreatmentVitals.systolicMin; top : vTreatmentVitals.systolicMax } + nextInput : _bloodPressureDiastolic + textInput.color : (textInput.acceptableInput && _private.isBloodPressureCompareValid) ? Colors.textMain : Colors.red + useQtNumPad : false + showPlaceHolderText : true + + onClicked: numPad.open ( _bloodPressureSystolic, + qsTr("Systolic"), + vTreatmentVitals.systolicMin, + vTreatmentVitals.systolicMax, + Variables.unitTextBloodPressure) + } + Label { + text : "/" + width : 10 + } + TextEntry { id : _bloodPressureDiastolic + text : Variables.notSetVariable(vTreatmentVitals.diastolic, 0) + textInput.font.pixelSize: Fonts.fontPixelValueControl + line.visible : false + validator : IntValidator { bottom: vTreatmentVitals.diastolicMin; top : vTreatmentVitals.diastolicMax } + nextInput : _heartRate + textInput.color : (textInput.acceptableInput && _private.isBloodPressureCompareValid) ? Colors.textMain : Colors.red + useQtNumPad : false + showPlaceHolderText : true + + onClicked : numPad.open ( _bloodPressureDiastolic, + qsTr("Diastolic"), + vTreatmentVitals.diastolicMin, + _bloodPressureSystolic.textInput.acceptableInput && + _bloodPressureSystolic.text < vTreatmentVitals.diastolicMax ? _bloodPressureSystolic.text : + vTreatmentVitals.diastolicMax, + Variables.unitTextBloodPressure) + } } - Label { - text : Variables.unitTextBloodPressure - width : unitWidth - } } - Row { - spacing : 10 - TextEntry { id : _heartRate - text : Variables.notSetVariable(vTreatmentVitals.heartRate, 0) - label.text : qsTr("Heart Rate") - label.width : _root.labelWidth - validator : IntValidator { bottom: vTreatmentVitals.heartRateMin; top : vTreatmentVitals.heartRateMax } - useQtNumPad : false + LabelUnitContainer { id: _heartRateContainer + text : qsTr("Heart Rate") + unitText : Variables.unitTextHeartBeat + width : _root.controlWidth + height : _root.controlHeight + + contentItem : TextEntry { id: _heartRate + text : Variables.notSetVariable(vTreatmentVitals.heartRate, 0) + anchors.centerIn : parent + textInput.font.pixelSize : Fonts.fontPixelValueControl + line.visible : false + validator : IntValidator { bottom: vTreatmentVitals.heartRateMin; top : vTreatmentVitals.heartRateMax } + useQtNumPad : false + showPlaceHolderText : true + onClicked : numPad.open ( _heartRate, qsTr("Heart Rate"), vTreatmentVitals.heartRateMin, vTreatmentVitals.heartRateMax, Variables.unitTextHeartBeat) } - Label { - text : Variables.unitTextHeartBeat - width : unitWidth + } + + LabelUnitContainer { id: _bpMeasurementInterval + text : qsTr("BP Measurement Interval") + unitText : Variables.unitTextDuration + valid : ! vTreatmentCreate.bloodPressureMeasureIntervalRejectReason + width : _root.controlWidth + height : _root.controlHeight + + contentItem : ValueAdjuster { id: _bpMeasurementIntervalControl + minimum : vTreatmentRanges.bloodPressureMeasureIntervalMin + maximum : vTreatmentRanges.bloodPressureMeasureIntervalMax + step : vTreatmentRanges.bloodPressureMeasureIntervalRes + defaultValue : vTreatmentRanges.bloodPressureMeasureIntervalDef + value : vTreatmentCreate.bloodPressureMeasureInterval + canOff : true + isActive : vTreatmentCreate.bloodPressureMeasureIntervalSet + + onDidActiveChange : function(vState) { vTreatmentCreate.bloodPressureMeasureIntervalSet = vState } + onDidChange : function(vValue) { + if ( ! _bpMeasurementInterval.valid ) { vTreatmentCreate.bloodPressureMeasureIntervalRejectReason = Variables.noRejectReason } + vTreatmentCreate.bloodPressureMeasureInterval = vValue + numPad.slideClose () + } } } } Index: sources/gui/qml/compounds/LabelUnitContainer.qml =================================================================== diff -u --- sources/gui/qml/compounds/LabelUnitContainer.qml (revision 0) +++ sources/gui/qml/compounds/LabelUnitContainer.qml (revision 477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2) @@ -0,0 +1,90 @@ +/*! + * + * Copyright (c) 2021-2025 Diality Inc. - All Rights Reserved. + * \copyright + * 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 LabelUnitContainer.qml + * \author (last) Nico Ramirez + * \date (last) 21-Aug-2025 + * \author (original) Nico Ramirez + * \date (original) 21-Aug-2025 + * + */ + +// Qt +import QtQuick 2.12 + +// Qml +import "qrc:/globals" +import "qrc:/components" +import "qrc:/pages/pretreatment" + +Rectangle { id: _root + property Item contentItem : null + property alias contentArea : _contentArea + + property alias text : _title.text + property string unitText: "" + property bool valid : true + property bool showUnit : true + property bool showEdit : false + + height : cellHeight + width : cellWidth + radius : 8.5 + color : Colors.panelBackgroundColor + + border { + width: 1 + color: valid ? Colors.panelBorderColor : Colors.panelInvalidBorderColor + } + + signal editClicked() + + Row { id: _titleRow + anchors { + verticalCenter : parent.verticalCenter + left : parent.left + leftMargin : Variables.defaultMargin + } + spacing : 10 + + Text { id: _title + anchors.verticalCenter : _titleRow.verticalCenter + color : Colors.offWhite + font.pixelSize : 28 + } + + Text { id: _unit + anchors.bottom : _title.bottom + text : ("(%1)").arg(_root.unitText) + color : Colors.offWhite + font.pixelSize : 22 + font.weight : Font.Thin + visible : _root.showUnit + } + + IconButton { id : _editButton + anchors.verticalCenter : _title.verticalCenter + anchors.verticalCenterOffset : 5 + visible : _root.showEdit + iconImageSource : "qrc:/images/iEdit" + onPressed : _root.editClicked() + iconSize : Variables.iconsDiameter + } + } + + ContentArea { id : _contentArea + anchors { + top : _root.top + left : _root.left + leftMargin : _root.width / 2 + right : _root.right + bottom : _root.bottom + } + + contentItem: _root.contentItem + } +} Index: sources/gui/qml/compounds/NumPad.qml =================================================================== diff -u -rd3c42a4b5e5858503ac3102b9b1bfeab81235762 -r477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2 --- sources/gui/qml/compounds/NumPad.qml (.../NumPad.qml) (revision d3c42a4b5e5858503ac3102b9b1bfeab81235762) +++ sources/gui/qml/compounds/NumPad.qml (.../NumPad.qml) (revision 477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2) @@ -36,8 +36,8 @@ readonly property string backSpace : "qrc:/images/iBackspace" property bool isOpened : false - width : 450 - height : 500 + width : Variables.numPadWidth + height : Variables.numPadHeight visible : false radius : 9 color : Colors.backgroundMain @@ -85,6 +85,13 @@ else if ( _root.visible ) { _root.visible = false } } + function slideClose () { + if ( isOpened ) { + x = x - _root.width + isOpened = false + } + } + function reset() { _numPadGrid.replaceValueText = true _root.getter = null @@ -103,7 +110,7 @@ width : height radius : height border.color : Colors.transparent - backgroundColor : "#455B78" + backgroundColor : Colors.backgroundButtonSelect onPressed : isOpened ? hide() : show() Image { id : _iconImage Index: sources/gui/qml/compounds/ValueAdjuster.qml =================================================================== diff -u --- sources/gui/qml/compounds/ValueAdjuster.qml (revision 0) +++ sources/gui/qml/compounds/ValueAdjuster.qml (revision 477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2) @@ -0,0 +1,208 @@ +/*! + * + * Copyright (c) 2021-2025 Diality Inc. - All Rights Reserved. + * \copyright + * 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 ValueAdjuster.qml + * \author (last) Nico Ramirez + * \date (last) 21-Aug-2025 + * \author (original) Nico Ramirez + * \date (original) 21-Aug-2025 + * + */ + +import "qrc:/globals" +import "qrc:/components" + +import QtQuick 2.12 +import QtQuick.Controls 2.2 + +Item { id: _root + property real decimal : 0 + property real minimum : 0 + property real maximum : 0 + property real value : 0 + property real defaultValue: 0 + property real step : 0 + property bool isActive : false + property bool editable : true + property bool canOff : false + property bool canRefresh : false + + // fix floating-point precision issue + readonly property real stepVal : Math.round(step * 100) / 100 + readonly property real minVal : Math.round(minimum * 100) / 100 + readonly property real val : Math.round(value * 100) / 100 + + readonly property bool canIncrement : isActive ? value < maximum : true + readonly property bool canDecrement : isActive ? canOff ? value > 0 : + value > minimum : true + + signal didChange (real vValue) + signal didActiveChange (bool vState) + + onIsActiveChanged : { + if ( canRefresh ) { canRefresh = false; return; } + + if ( isActive ) { didChange(_root.defaultValue) } + } + + function refresh() { canRefresh = true } + + function clear() { didActiveChange(false) } + + function increment() { + let tValue = value + if ( ! isActive ) { didActiveChange(true); return; } + + if ( canOff ) { tValue = val < minVal ? minVal : val + stepVal } + else { tValue += stepVal } + + didChange(tValue) + + } + + function decrement(vValue) { + let tValue = value + if ( ! isActive ) { didActiveChange(true); return; } + + if ( canOff ) { tValue = val > minVal ? val - stepVal : 0 } + else { tValue -= stepVal } + + didChange(tValue) + } + + Text { id: _text + anchors.centerIn: parent + text : _root.isActive ? _root.canOff ? _root.value === 0 ? + "OFF" : + _root.value.toFixed( _root.decimal ) : + _root.value.toFixed( _root.decimal ) : Variables.emptyEntry + color : Colors.offWhite + font.pixelSize : Fonts.fontPixelValueControl + } + + Slider { id: _slider + property real pos : 0 + + anchors.fill : parent + anchors.rightMargin : Variables.defaultMargin * 3 + anchors.leftMargin : Variables.defaultMargin * 2 + anchors.topMargin : 5 + enabled : _root.editable + visible : enabled + opacity : 0 + stepSize : _root.step + from : _root.minimum .toFixed ( _root.decimal ) + to : _root.maximum .toFixed ( _root.decimal ) + value : _root.value .toFixed ( _root.decimal ) + snapMode : Slider.SnapOnRelease + + background: Rectangle { + color: "transparent" + Rectangle { + anchors{ + top : parent.top + topMargin : 1.5 + left : parent.left + right : parent.right + rightMargin : Variables.defaultMargin * -1 + } + height : 1 + width : parent.width + color : Colors.panelBorderColor + } + } + + handle: Rectangle { id: _knob + width : 20 + height : 4 + radius : height + color : Colors.borderButton + x : _slider.pos * _slider.width + } + + MouseArea { id: _sliderMouseArea + property bool grabbed: false + + anchors.fill : parent + pressAndHoldInterval: 0 + + onClicked: { + if ( _root.editable ) { didActiveChange(true); focus = true } + + _slider.opacity = 0 + } + + onReleased: { + _sliderMouseArea.grabbed = true +. grabbed = false + _slider.opacity = 0 + } + + onPressAndHold: { + if ( _root.editable ) { didActiveChange(true); focus = true } + + _sliderMouseArea.grabbed = true + } + + onPositionChanged: { + if (grabbed) { + if ( _slider.opacity === 0 ) { _animator.start() } + + _slider.pos = Math.max(0, Math.min(1, mouse.x / parent.width)) + let raw = _slider.from + _slider.pos * (_slider.to - _slider.from) + let stepped = Math.round((raw - _slider.from) / _root.step) * _root.step + _slider.from + didChange(stepped) + } + } + + onExited: { + if ( ! _sliderMouseArea.grabbed ) { + _animator.stop() + _slider.opacity = 0 + } + } + } + + OpacityAnimator { id: _animator + target : _slider + from : 0 + to : 1 + duration: 350 + running : _sliderMouseArea.grabbed + } + + Behavior on opacity { NumberAnimation { duration: 200 } } + } + + IconButton { id: _leftArrow + anchors { + verticalCenter : _root.verticalCenter + left : _root.left + leftMargin : Variables.defaultMargin + } + iconSize : Variables.circleButtonDefaultDiameter + enabled : _root.canDecrement + visible : _root.editable + iconImageSource : enabled ? "qrc:/images/iArrowLeft" : + "qrc:/images/iArrowLeftDisabled" + onClicked : decrement() + } + + IconButton { id: _rightArrow + anchors { + verticalCenter : _root.verticalCenter + right : _root.right + rightMargin : Variables.defaultMargin + } + iconSize : Variables.circleButtonDefaultDiameter + enabled : _root.canIncrement + visible : _root.editable + iconImageSource : enabled ? "qrc:/images/iArrowRight" : + "qrc:/images/iArrowRightDisabled" + onClicked : increment() + } +} Index: sources/gui/qml/globals/Colors.qml =================================================================== diff -u -rc1d0546e2d1a51ff919b2172ce647003359f0853 -r477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2 --- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision c1d0546e2d1a51ff919b2172ce647003359f0853) +++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2) @@ -30,6 +30,7 @@ readonly property color red : "#c53b33" // red readonly property color white : "white" // white readonly property color transparent : "Transparent" // No Color + readonly property color offWhite : "#FEFEFE" readonly property color separatorLine : "#5f809d" readonly property color backgroundMain : "#1A344D" //// ----- @LEAHIZED @@ -88,6 +89,10 @@ readonly property color buttonDisableColor : "#515050" readonly property color pauseColor : "#9B864E" + readonly property color panelBackgroundColor : "#12FFFFFF" + readonly property color panelBorderColor : "#4DB5B5B5" + readonly property color panelInvalidBorderColor : "#FFA500" + readonly property color touchTextAreaTitle : "#a0b6d0" readonly property color textTextRectTitle : white Index: sources/gui/qml/globals/Fonts.qml =================================================================== diff -u -rf7d7e8b10c7626f3c6b8450876721a452ebd730f -r477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2 --- sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision f7d7e8b10c7626f3c6b8450876721a452ebd730f) +++ sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision 477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2) @@ -49,6 +49,7 @@ readonly property int fontPixelPresseuresText : 22 readonly property int fontPixelPresseuresLabel : 28 + readonly property int fontPixelValueControl : 35 readonly property int fontPixelFluidText : 22 readonly property int fontPixelFluidValue : 32 Index: sources/gui/qml/globals/Variables.qml =================================================================== diff -u -rf7d7e8b10c7626f3c6b8450876721a452ebd730f -r477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2 --- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision f7d7e8b10c7626f3c6b8450876721a452ebd730f) +++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2) @@ -118,6 +118,8 @@ readonly property int sliderCircleDiameter : 30 readonly property int pressuresProgressbarWidth : 725 + readonly property int numPadHeight : 525 + readonly property int numPadWidth : 450 readonly property int gridSelectionButtonHeight : 100 readonly property int gridSelectionButtonWidth : 375 @@ -204,6 +206,13 @@ readonly property int noRejectReason : 0 + readonly property int textBoxRadius : 5 + readonly property int textBoxBorderWidth : 2 + readonly property int adjustmentDialogWidth : applicationWidth * 0.7 + readonly property int adjustmentDialogHeight : applicationHeight * 0.7 + readonly property int adjustmentHeaderHeight : 120 + readonly property int adjustmentButtonMargin : 30 + // ---------- < PRS > Related Section ---------- // blood flow rate readonly property int bloodFlowMin : 100 // PRS 30 @@ -258,6 +267,7 @@ // otherwise an extra RegExpValidator object will always created here. readonly property var regExp_PatientID: /[A-Za-z0-9_\-\.]{1,64}/ + readonly property string emptyEntry : "-- --" readonly property string preTreatmentStepLabelCreate : qsTr("CREATE" ) readonly property string preTreatmentStepLabelConfirm : qsTr("CONFIRM" ) Index: sources/gui/qml/pages/pretreatment/connection/PreTreatmentConnectionStack.qml =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2 --- sources/gui/qml/pages/pretreatment/connection/PreTreatmentConnectionStack.qml (.../PreTreatmentConnectionStack.qml) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/gui/qml/pages/pretreatment/connection/PreTreatmentConnectionStack.qml (.../PreTreatmentConnectionStack.qml) (revision 477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2) @@ -49,8 +49,6 @@ header.confirmEnabled : _bphrEntry.isValid title.text : qsTr("BP/HR") BPHREntry { id: _bphrEntry - topMarginContent : 250 - contentRectHeight : _root.height } TouchRect { id: _enterBluetoothScreen visible : vBluetooth.pairedAddr == "" // empty pairedAddr indicate not paired Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentBase.qml =================================================================== diff -u -ree27c59d21daf9ad067d3cb5327fadd7c73b9838 -r477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentBase.qml (.../TreatmentAdjustmentBase.qml) (revision ee27c59d21daf9ad067d3cb5327fadd7c73b9838) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentBase.qml (.../TreatmentAdjustmentBase.qml) (revision 477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2) @@ -27,54 +27,73 @@ * For all adjustment screens in treatment */ ModalDialog { id: _root - contentItem.objectName : "TreatmentAdjustmentBase" //SquishQt testability + contentItem.objectName: "TreatmentAdjustmentBase" //SquishQt testability property string titleText: "" property bool closeVisible: true - property bool confirmVisible: true + property bool confirmVisible: false property bool backVisible: false property alias information: _information - property bool confirmEnabled: true signal closeClicked() signal confirmClicked() signal backClicked() - y: Math.round((Variables.applicationHeight - height) / 2) - Variables.headerHeight + width : Variables.adjustmentDialogWidth + height : Variables.adjustmentDialogHeight + y : Math.round((Variables.applicationHeight - height) / 2) - Variables.headerHeight onVisibleChanged: { notificationText = "" } - header: - Rectangle { id : _headerRect + header: Item { id : _headerRect + implicitHeight: Variables.adjustmentHeaderHeight + // TODO: remove ConfirmButton later once it is moved out into screens that inherit this ConfirmButton { id : _confirmButton + anchors { + right : parent.right + verticalCenter : _backButton.verticalCenter + margins : Variables.adjustmentButtonMargin + } visible: _root.confirmVisible - enabled: _root.confirmEnabled - onClicked : confirmClicked() } + BackButton { id : _backButton + anchors { + top : parent.top + left : parent.left + margins : Variables.adjustmentButtonMargin + } visible: _root.backVisible onClicked : backClicked() } TitleText { id : _titleText text: titleText - font.pixelSize: Fonts.fontPixelButton - color: Colors.textMain - height: Variables.mainMenuHeight + font { + pixelSize : Fonts.fontPixelTitle + weight : Font.Medium + } + color : Colors.textMain + width : contentWidth + height : contentHeight anchors { - top: parent.top - horizontalCenter: parent.horizontalCenter - margins: 35 + bottom : parent.bottom + horizontalCenter : parent.horizontalCenter + margins : Variables.defaultMargin } } CloseButton { id : _closeButton + anchors { + right : parent.right + verticalCenter : _backButton.verticalCenter + margins : Variables.adjustmentButtonMargin + } visible: _root.closeVisible - anchors.left: parent.left onClicked : { closeClicked() close() Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentVitals.qml =================================================================== diff -u -r736a7be958ca343f17b50e9e0d85cd395e8037e7 -r477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentVitals.qml (.../TreatmentAdjustmentVitals.qml) (revision 736a7be958ca343f17b50e9e0d85cd395e8037e7) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentVitals.qml (.../TreatmentAdjustmentVitals.qml) (revision 477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2) @@ -23,21 +23,22 @@ TreatmentAdjustmentBase { id: _root contentItem.objectName: "TreatmentAdjustmentVitals" - titleText : qsTr("VITALS") - confirmEnabled : _bphrEntry.isValid - height : 500 - width : 750 + height : Variables.numPadHeight + width : 850 x : numPad.isOpened ? Math.round((Variables.applicationWidth - width) / 2) - 200 : Math.round((Variables.applicationWidth - width) / 2) notification.textfontSize: 20 notification.visible: vTreatmentVitals.lastRead || vTreatmentAdjustmentVitals.adjustment_ReasonText - property string notificationTextString: qsTr("Interval:" ) - + " " + (vTreatmentVitals.interval ? (vTreatmentVitals.interval + qsTr("min")) : qsTr("OFF")) - + " , " - + qsTr("Last Read:") - + " " + vTreatmentVitals.lastRead + readonly property string intervalTextString : qsTr("Interval:" ) + + " " + (vTreatmentVitals.interval ? (vTreatmentVitals.interval + qsTr("min")) : qsTr("OFF")) + + " , " + + qsTr("Last Read:") + + " " + vTreatmentVitals.lastRead + readonly property string rejectionTextString : qsTr("Rejected Reason: %1").arg(vTreatmentAdjustmentVitals.adjustment_ReasonText) + readonly property string notificationTextString : vTreatmentAdjustmentVitals.adjustment_ReasonText ? rejectionTextString : + intervalTextString function update(vSystolic, vDiastolic ,vHeartRate) { _bphrEntry.systolic = vSystolic ? vSystolic : "" @@ -55,47 +56,87 @@ } onOpened: { - notificationText = vTreatmentAdjustmentVitals.adjustment_ReasonText ? qsTr("Rejected Reason: %1").arg(vTreatmentAdjustmentVitals.adjustment_ReasonText) : - notificationTextString + notificationText = notificationTextString vTreatmentVitals.doTimerStop() } onClosed: vTreatmentVitals.doTimerStart() - onConfirmClicked: { - numPad.hide() - _root.close() - _root.confirm() - } - onCloseClicked: { numPad.hide() vTreatmentVitals.doSkip() } - BPHREntry { id: _bphrEntry - contentRectHeight : 350 + BPHREntry { id: _bphrEntry } + + Row { id: _buttonRow + spacing: Variables.defaultMargin * 2 + + anchors { + bottom : _root.contentItem.bottom + bottomMargin : notification.visible ? Variables.defaultMargin * 4.5 : Variables.defaultMargin * 2 + horizontalCenter: _root.contentItem.horizontalCenter + } + + TouchRect { id : _requestButton + width : Variables.confirmButtonWidth + height : Variables.contentHeight + isDefault : true + + text { + text : qsTr("REQUEST") + font.bold : true + font.pixelSize : Fonts.fontPixelConfirm + } + + onClicked: { vTreatmentAdjustmentVitals.doRequest() ; print ("BPHREntry doRequest") } + } + + ConfirmButton { id : _confirmButton + enabled : _bphrEntry.isValid + + anchors { + top : undefined + right : undefined + margins : 0 + } + onClicked : { + numPad.hide() + _root.close() + _root.confirm() + } + } + + Behavior on anchors.bottomMargin { NumberAnimation { duration: 300} } } Connections { target: vTreatmentVitals - function onDidTrigger () { - vTreatmentAdjustmentVitals.doRequest() - } + function onDidTrigger () { vTreatmentAdjustmentVitals.doRequest() } } Connections { target: vTreatmentAdjustmentVitals function onAdjustmentTriggered ( vValue ) { if ( vTreatmentAdjustmentVitals.adjustment_Accepted ) { // on accepted read vital data and populate _root.update ( vTreatmentVitals.systolic__rt, vTreatmentVitals.diastolic_rt, vTreatmentVitals.heartRate_rt ) - _root.confirm() - vTreatmentVitals.doTimerStart() + + // confirm only if triggered from interval timer and popup is not open + if ( ! _root.visible) { + _root.confirm() + vTreatmentVitals.doTimerStart() + } } else { // on rejected prompt user to enter vitals manually if ( vTreatmentVitals.enableDialog ) { _root.open () } + + notificationText = rejectionTextString + _bphrEntry.systolic = "" + _bphrEntry.diastolic = "" + _bphrEntry.heartRate = "" } + } }