Index: sources/gui/qml/compounds/BPHREntry.qml =================================================================== diff -u -r6233e005c77ee0aa10e80c02254a21f2042b840b -rc4dffe90d1a236a107599027b0b4248d25314af6 --- sources/gui/qml/compounds/BPHREntry.qml (.../BPHREntry.qml) (revision 6233e005c77ee0aa10e80c02254a21f2042b840b) +++ sources/gui/qml/compounds/BPHREntry.qml (.../BPHREntry.qml) (revision c4dffe90d1a236a107599027b0b4248d25314af6) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 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) 23-Sep-2024 * \author (original) Behrouz NematiPour - * \date (last) 20-Jun-2021 - * \date (original) 20-Jun-2021 + * \date (original) 21-Jun-2021 * */ @@ -44,12 +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 } } @@ -67,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 : "/" @@ -78,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")