Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationConfirm.qml =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -rbe27a57e3051a56b73c3549c383fbba1f85ac8e3 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationConfirm.qml (.../TreatmentAdjustmentUltrafiltrationConfirm.qml) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationConfirm.qml (.../TreatmentAdjustmentUltrafiltrationConfirm.qml) (revision be27a57e3051a56b73c3549c383fbba1f85ac8e3) @@ -30,16 +30,13 @@ TreatmentAdjustmentBase { id: _root contentItem.objectName: "TreatmentAdjustmentUltrafiltrationConfirm" //SquishQt testability + property real ultrafiltrationVolume : 0.000 + property real ultrafiltrationRate : 0.000 + QtObject { id: _private property int decimalVolume: Variables.ultrafiltrationPrecision property int decimalRate : 0 } - property real ultrafiltrationVolume : 0.000 - property int treatmentDuration : 0 - property int treatmentDurationDiff : 0 - property real ultrafiltrationRate : 0.000 - property real ultrafiltrationRateDiff : 0.000 - property real ultrafiltrationRateOld : 0.000 signal confirmRateClicked (real vVolume) signal confirmDurationClicked(real vVolume) @@ -49,107 +46,133 @@ backVisible : true information { - visible : true && information.text && ! notification.visible - imageSource : ufInfoImageSource - text : ufInfoText + visible : true && information.text && ! notification.visible + imageSource : ufInfoImageSource + text : ufInfoText + radius : 0 + color : Colors.ufNotificationBarBg + textColor : Colors.ufVolumeGoalText + textfontSize : Fonts.fontPixelUltrafiltrationAdjustmentNotification + textfontWeight : Font.Medium } - titleText : qsTr("ULTRAFILTRATION VOLUME") + " " + Variables.unitTextUltrafiltrationVolume + titleText : qsTr("Confirm Ultrafiltration Volume ") + Variables.unitTextUltrafiltrationVolume - function reset() { - _rateAdjustmentButton.selected = false - _durationAdjustmentButton.selected = false - } - - TitleText { id : _titleText - text: qsTr("To confirm new UF Volume (%1),\nselect a treatment adjustment:") - .arg(ultrafiltrationVolume.toFixed(_private.decimalVolume)) - font.pixelSize: Fonts.fontPixelTitle - color: Colors.textMain - height: Variables.mainMenuHeight + Item { id: _contentArea anchors { - top: parent.top - topMargin: 100 - horizontalCenter: parent.horizontalCenter + top : parent.top + bottom : _confirmButton.top + left : parent.left + right : parent.right } - } - TouchRect { id: _confirmButton - width : 530 - height : 70 - anchors { - bottom: parent.bottom - bottomMargin: 85 - horizontalCenter: parent.horizontalCenter - } - isDefault : true - enabled : _rateAdjustmentButton.selected || _durationAdjustmentButton.selected - text { - text: qsTr("CONFIRM") - font.weight: Font.DemiBold - font.pixelSize: Fonts.fontPixelUltrafiltrationAdjustmentConfirmButton - } - onClicked: { - if (_rateAdjustmentButton.selected) { - confirmRateClicked(ultrafiltrationVolume) - return + Row { id: _contentRow + anchors.centerIn: parent + spacing : 150 + + Column { id: _leftContent + spacing: 20 + Text { + font { + pixelSize : Fonts.fontPixelUltrafiltrationAdjustmentNotification + weight : Font.Medium + } + color : "white" + text : qsTr("New UF Volume:") + } + + Item { + width : childrenRect.width + height : childrenRect.height + + Text { id: _newUfVolumeValue + width: contentWidth + font { + pixelSize : Fonts.fontPixelUltrafiltrationAdjustmentConfirmation + weight : Font.DemiBold + } + horizontalAlignment : Text.AlignVBottom + color : Colors.ufVolumeGoalText + text : _root.ultrafiltrationVolume.toFixed(Variables.ultrafiltrationPrecision) + } + + Text { id: _newUfVolumeUnit + anchors { + left : _newUfVolumeValue.right + verticalCenter : _newUfVolumeValue.verticalCenter + verticalCenterOffset: (_newUfVolumeValue.height - height) * 0.25 + } + font { + pixelSize : _newUfVolumeValue.font.pixelSize * 0.6 + weight : Font.Medium + } + horizontalAlignment : Text.AlignVBottom + color : _newUfVolumeValue.color + text : " " + Variables.unitVolume + } + } } - if (_durationAdjustmentButton.selected) { - confirmDurationClicked(ultrafiltrationVolume) - return + + Column { id: _rightContent + spacing: _leftContent.spacing + Text { + font { + pixelSize : Fonts.fontPixelUltrafiltrationAdjustmentNotification + weight : Font.Medium + } + color : "white" + text : qsTr("New UF Rate:") + } + + Item { + width : childrenRect.width + height : childrenRect.height + + Text { id: _newUfRateValue + width: contentWidth + font { + pixelSize : Fonts.fontPixelUltrafiltrationAdjustmentConfirmation + weight : Font.DemiBold + } + horizontalAlignment : Text.AlignVCenter + color : Colors.ufVolumeGoalText + text : _root.ultrafiltrationRate.toFixed(Variables.ultrafiltrationPrecision) + } + + Text { id: _newUfRateUnit + anchors { + left : _newUfRateValue.right + verticalCenter : _newUfRateValue.verticalCenter + verticalCenterOffset: (_newUfRateValue.height - height) * 0.25 + } + font { + pixelSize : _newUfVolumeUnit.font.pixelSize + weight : _newUfVolumeUnit.font.weight + } + horizontalAlignment : Text.AlignVCenter + color : _newUfVolumeValue.color + text : " " + Variables.unitTextRate + } + } } - confirmClicked() } } - Row { - spacing: 20 + TouchRect { id: _confirmButton anchors { - top: parent.top - topMargin: 205 + bottom : information.top + bottomMargin : Variables.ultrafiltrationButtonBottomMargin horizontalCenter: parent.horizontalCenter } - UltrafiltrationButton { id: _rateAdjustmentButton - titleString : qsTr("%1 UF Rate") - descriptionString : qsTr("The rate %3 by %1 %2,\nthe treatment duration remains the same.") - .arg(Math.abs(ultrafiltrationRateDiff .toFixed(_private.decimalRate))) - .arg(Variables.unitTextUltrafiltrationRate) - buttonType : UltrafiltrationButton.ButtonType.UltrafiltrationRate - isIncrease : ultrafiltrationRateDiff > 0 - valueText : qsTr( "UF Rate : %1 %2") - .arg(ultrafiltrationRate .toFixed(_private.decimalRate)) - .arg(Variables.unitTextUltrafiltrationRate) - onClicked : { - _durationAdjustmentButton.selected = false - selected = true - } - disabled: ultrafiltrationRate == 0 && ultrafiltrationRateDiff == 0 + width : Variables.ultrafiltrationButtonWidth + height : Variables.ultrafiltrationButtonHeight + isDefault : true + text { + text : qsTr("Confirm") + font.weight : Font.DemiBold + font.pixelSize : Fonts.fontPixelUltrafiltrationAdjustmentButton } - UltrafiltrationButton { id: _durationAdjustmentButton - titleString : qsTr("%1 Treatment Duration") - descriptionString : qsTr("The rate remains, the treatment\nduration %2 by %1 minutes.") - .arg(Math.abs(treatmentDurationDiff)) - buttonType: UltrafiltrationButton.ButtonType.TreatmentDuration - isIncrease: treatmentDurationDiff > 0 - valueText : qsTr( "UF Rate : %1 %2") - .arg(ultrafiltrationRateOld .toFixed(_private.decimalRate)) - .arg(Variables.unitTextUltrafiltrationRate) - onClicked : { - _rateAdjustmentButton.selected = false - selected = true - } - visible : false - disabled: treatmentDuration == 0 && treatmentDurationDiff == 0 - } + onClicked: confirmClicked() } - - onConfirmClicked: { - _durationAdjustmentButton.selected = false - _rateAdjustmentButton.selected = false - } - onBackClicked: { - _durationAdjustmentButton.selected = false - _rateAdjustmentButton.selected = false - } }