Index: sources/gui/qml/compounds/BPHREntry.qml =================================================================== diff -u -r9c86f0af32fb7a2530ab738b03d9a37359b9db8c -rc4dffe90d1a236a107599027b0b4248d25314af6 --- sources/gui/qml/compounds/BPHREntry.qml (.../BPHREntry.qml) (revision 9c86f0af32fb7a2530ab738b03d9a37359b9db8c) +++ sources/gui/qml/compounds/BPHREntry.qml (.../BPHREntry.qml) (revision c4dffe90d1a236a107599027b0b4248d25314af6) @@ -1,13 +1,13 @@ /*! * - * Copyright (c) 2021-2023 Diality Inc. - All Rights Reserved. + * Copyright (c) 2021-2024 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 BPHREntry.qml * \author (last) Behrouz NematiPour - * \date (last) 14-Jan-2022 + * \date (last) 23-Sep-2024 * \author (original) Behrouz NematiPour * \date (original) 21-Jun-2021 * @@ -44,19 +44,30 @@ _bloodPressureSystolic .isValid && _bloodPressureDiastolic .isValid && _heartRate .isValid + && _private.isBloodPressureCompareValid signal clicked() width : _container.width height : _container.height + function clear() { + _root.systolic = "" + _root.diastolic = "" + _root.heartRate = "" + } + function setFocus(vShowKeyboard) { if(vShowKeyboard) { firstInput.textInput.forceActiveFocus() _keyboard.setVisible(true) } } + QtObject { id: _private + property bool isBloodPressureCompareValid : (parseInt(_bloodPressureDiastolic.text) <= parseInt(_bloodPressureSystolic.text)) + } + anchors.horizontalCenter: parent.horizontalCenter y : Qt.inputMethod.visible && _keyboard.visible ? _root.topMarginContent : ( ( _root.contentRectHeight - _container.height ) / 2 ) Behavior on y { NumberAnimation { duration: Variables.keybardAnimationDuration } } @@ -74,6 +85,7 @@ validator : IntValidator { bottom: vTreatmentVitals.systolicMin; top : vTreatmentVitals.systolicMax } onClicked : _root.clicked() nextInput : _bloodPressureDiastolic + textInput.color: (textInput.acceptableInput && _private.isBloodPressureCompareValid) ? Colors.textMain : Colors.red } Label { text : "/" @@ -85,6 +97,7 @@ validator : IntValidator { bottom: vTreatmentVitals.diastolicMin; top : vTreatmentVitals.diastolicMax } onClicked : _root.clicked() nextInput : _heartRate + textInput.color: (textInput.acceptableInput && _private.isBloodPressureCompareValid) ? Colors.textMain : Colors.red } Label { text : qsTr("mmHg")