Index: sources/gui/qml/compounds/BPHREntry.qml =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r41a604f3fe3a5bb40bddd8c06e5fe88df85e3997 --- sources/gui/qml/compounds/BPHREntry.qml (.../BPHREntry.qml) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/gui/qml/compounds/BPHREntry.qml (.../BPHREntry.qml) (revision 41a604f3fe3a5bb40bddd8c06e5fe88df85e3997) @@ -26,90 +26,102 @@ * \details and dynamically creates list of items which can be later set as started/done to have * 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 - + Item { id: _root property alias systolic : _bloodPressureSystolic.text property alias diastolic : _bloodPressureDiastolic.text property alias heartRate : _heartRate.text - readonly property bool isValid : + readonly property int contentPadding : Variables.defaultMargin * 7 + readonly property bool isValid : _bloodPressureSystolic .isValid && _bloodPressureDiastolic .isValid && _heartRate .isValid && _private.isBloodPressureCompareValid - signal clicked() + width : _container.width + height : _container.height - width : _container.width - height : _container.height - - 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 } } + Column { id: _container + spacing : 15 + leftPadding : _root.contentPadding + anchors.fill : parent - Row { id: _container - spacing: 50 - anchors.centerIn: parent - Column { spacing : 25 - leftPadding : _root.titleIndent - Row { spacing : 10 + LabelUnitContainer { id: _bpContainer + text : qsTr("Blood Pressure") + unitText : Variables.unitTextBloodPressure + width : Variables.adjustmentLabelUnitContainerWidth + height : Variables.adjustmentLabelUnitContainerHeight + + contentItem : Row { + spacing : 10 + anchors.centerIn: parent + 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 } - onClicked : _root.clicked() - nextInput : _bloodPressureDiastolic - textInput.color: (textInput.acceptableInput && _private.isBloodPressureCompareValid) ? Colors.textMain : Colors.red + 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) - label.width : 0 - validator : IntValidator { bottom: vTreatmentVitals.diastolicMin; top : vTreatmentVitals.diastolicMax } - onClicked : _root.clicked() - nextInput : _heartRate - textInput.color: (textInput.acceptableInput && _private.isBloodPressureCompareValid) ? Colors.textMain : Colors.red + 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 : qsTr("mmHg") - width : unitWidth - } } - Row { spacing : 10 - TextEntry { id : _heartRate - text : Variables.notSetVariable(vTreatmentVitals.heartRate, 0) - label.text : qsTr("Heart Rate") - label.width : _root.labelWidth - onClicked : _root.clicked() - validator : IntValidator { bottom: vTreatmentVitals.heartRateMin; top : vTreatmentVitals.heartRateMax } - } - Label { - text : qsTr("BPM") - width : unitWidth - } + } + + LabelUnitContainer { id: _heartRateContainer + text : qsTr("Heart Rate") + unitText : Variables.unitTextHeartBeat + width : Variables.adjustmentLabelUnitContainerWidth + height : Variables.adjustmentLabelUnitContainerHeight + + 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 } + nextInput : _bloodPressureSystolic + useQtNumPad : false + showPlaceHolderText : true + + onClicked : numPad.open ( _heartRate, + qsTr("Heart Rate"), + vTreatmentVitals.heartRateMin, + vTreatmentVitals.heartRateMax, + Variables.unitTextHeartBeat) } } }