Index: sources/gui/qml/pages/treatment/TreatmentCreate.qml =================================================================== diff -u -r66e87ea403ec12a273553284919684282d87bc6a -rdf74454a7a75eb63ac577739c1fd0f179e479f44 --- sources/gui/qml/pages/treatment/TreatmentCreate.qml (.../TreatmentCreate.qml) (revision 66e87ea403ec12a273553284919684282d87bc6a) +++ sources/gui/qml/pages/treatment/TreatmentCreate.qml (.../TreatmentCreate.qml) (revision df74454a7a75eb63ac577739c1fd0f179e479f44) @@ -31,8 +31,11 @@ objectName: "TreatmentCreate"; // SquishQt testability signal clickedBack() signal clickedContinue() - backgroundRect.color: Colors.backgroundMainMenu + function setInteractive(isInteractive) { + _flickable.interactive = isInteractive + } + TopMenuBarCreateTreatment { id: _topMenuBar anchors.top: parent.top anchors.left: parent.left @@ -53,10 +56,6 @@ clip: true flickDeceleration: Variables.createTreatmentFlickableDeceleration - function setInteractive(isInteractive) { - _flickable.interactive = isInteractive - } - ScrollBar.vertical: ScrollBar { id: _scrollBar anchors.right: _flickable.right anchors.rightMargin: 3 @@ -99,12 +98,12 @@ text: qsTr("Blood Flow Rate") units: qsTr("mL/min") onPressed: { - _flickable.setInteractive(false) + setInteractive(false) vTreatmentCreate.bloodFlowRate = value } onReleased: { vTreatmentCreate.bloodFlowRate = value - _flickable.setInteractive(true) + setInteractive(true) } } @@ -118,12 +117,12 @@ text: qsTr("Dialysate Flow Rate") units: qsTr("mL/min") onPressed: { - _flickable.setInteractive(false) + setInteractive(false) vTreatmentCreate.dialysateFlowRate = value; } onReleased: { vTreatmentCreate.dialysateFlowRate = value; - _flickable.setInteractive(true) + setInteractive(true) } } @@ -137,12 +136,12 @@ text: qsTr("Duration") units: qsTr("min") onPressed: { - _flickable.setInteractive(false) + setInteractive(false) vTreatmentCreate.duration = value; } onReleased: { vTreatmentCreate.duration = value; - _flickable.setInteractive(true) + setInteractive(true) } } @@ -156,12 +155,12 @@ text: qsTr("Heparin Dispensing Rate") units: qsTr("mL/hr") onPressed: { - _flickable.setInteractive(false) + setInteractive(false) vTreatmentCreate.heparinDispensingRate = value } onReleased: { vTreatmentCreate.heparinDispensingRate = value - _flickable.setInteractive(true) + setInteractive(true) } } @@ -176,12 +175,12 @@ text: qsTr("Heparin Bolus Volume") units: qsTr("mL") onPressed: { - _flickable.setInteractive(false) + setInteractive(false) vTreatmentCreate.heparinBolusVolume = value } onReleased: { vTreatmentCreate.heparinBolusVolume = value - _flickable.setInteractive(true) + setInteractive(true) } } @@ -195,12 +194,12 @@ text: qsTr("Heparin Stop Time") units: qsTr("min") onPressed: { - _flickable.setInteractive(false) + setInteractive(false) vTreatmentCreate.heparinStopTime = value } onReleased: { vTreatmentCreate.heparinStopTime = value - _flickable.setInteractive(true) + setInteractive(true) } } @@ -215,12 +214,12 @@ max: vTreatmentCreate.salineBolusVolumeMax step: vTreatmentCreate.salineBolusVolumeRes onPressed: { - _flickable.setInteractive(false) + setInteractive(false) vTreatmentCreate.salineBolusVolume = value } onReleased: { vTreatmentCreate.salineBolusVolume = value - _flickable.setInteractive(true) + setInteractive(true) } } @@ -266,101 +265,139 @@ text: qsTr("Dialysate Temperature") units: qsTr("C") onPressed: { - _flickable.setInteractive(false) + setInteractive(false) vTreatmentCreate.dialysateTemp = value } onReleased: { vTreatmentCreate.dialysateTemp = value - _flickable.setInteractive(true) + setInteractive(true) } } - Text { id: _arterialPressureLimitsTitle - text: qsTr("Arterial Pressure Limits") - anchors.left: _arterialPressureLimits.left - font.pixelSize: Fonts.fontPixelFluidText - color: Colors.textMain; + Column { id: _arterialColumn + spacing: 45 + anchors.horizontalCenter: parent.horizontalCenter + Text { id: _arterialLabel + visible : true + color : "white" + text: qsTr("Arterial Pressure Limits") + " " + "(" + Variables.unitTextBloodPressure + ")" + font.pixelSize : Fonts.fontPixelFluidText + anchors.left : _arterialPressureLimits.left + } + RangeSlider { id: _arterialPressureLimits + // dimension + height : 5 + width : Variables.createTreatmentSliderWidth + diameter : Variables.sliderCircleDiameter + anchors.horizontalCenter: parent.horizontalCenter + ticks : true + stepSnap : true + hasAdjusted : true - } + // Texts + lowerText.visible : true + lowerText.font.pixelSize : Fonts.fontPixelFluidText + lowerText.font.bold : false + lowerText.anchors.topMargin : -50 + lowerTextHorizontalCenter : true - SliderDoubleCreateTreatment { id: _arterialPressureLimits - objectName: "_arterialPressureLimits" - lowSliderObjectName: objectName + "LowSlider" - lowSelectedValueObjectName: objectName + "LowValue" - highSliderObjectName: objectName + "HighSlider" - highSelectedValueObjectName: objectName + "HighValue" - lowTitle: qsTr("Low") - lowUnits: qsTr("mmHg") - highTitle: qsTr("High") - highUnits: qsTr("mmHg") - lowMin: vTreatmentCreate.arterialPressureLimitLowMin - lowMax: vTreatmentCreate.arterialPressureLimitLowMax - highMin: vTreatmentCreate.arterialPressureLimitHighMin - highMax: vTreatmentCreate.arterialPressureLimitHighMax - lowValue: vTreatmentCreate.arterialPressureLimitLowMin - highValue: vTreatmentCreate.arterialPressureLimitHighMin - lowStep: vTreatmentCreate.arterialPressureLimitLowRes - highStep: vTreatmentCreate.arterialPressureLimitHighRes - onLowSliderPressed: { - _flickable.setInteractive(false) - vTreatmentCreate.arterialPressureLimitLow = lowValue + upperText.visible : true + upperText.font.pixelSize : Fonts.fontPixelFluidText + upperText.font.bold : false + upperText.anchors.topMargin : -50 + upperTextHorizontalCenter : true + + minText.visible : true + // minText.font.pixelSize : Fonts.fontPixelFluidText + minText.font.bold : false + minVerticalEdgeVisible : false + + maxText.visible : true + // maxText.font.pixelSize : Fonts.fontPixelFluidText + maxText.font.bold : false + maxVerticalEdgeVisible : false + + // Ranges + step : Variables.arterialLimitStep + gapValue : Variables.arterialLimitGap + minimum : vTreatmentCreate.arterialPressureLimitLowMin + maximum : vTreatmentCreate.arterialPressureLimitHighMax + minValue : vTreatmentCreate.arterialPressureLimitLowMin + maxValue : vTreatmentCreate.arterialPressureLimitHighMax + minValueLowerBound : vTreatmentCreate.arterialPressureLimitLowMin + minValueUpperBound : vTreatmentCreate.arterialPressureLimitLowMax + maxValueLowerBound : vTreatmentCreate.arterialPressureLimitHighMin + maxValueUpperBound : vTreatmentCreate.arterialPressureLimitHighMax + // scroll handling and value updates + onPressed : { setInteractive(false) } + onDragged : { setInteractive(false) } + onReleased: { setInteractive(true ) } + onMinValueChanged: if (minAdjusted) vTreatmentCreate.arterialPressureLimitLow = minValue + onMaxValueChanged: if (maxAdjusted) vTreatmentCreate.arterialPressureLimitHigh = maxValue } - onLowSliderReleased: { - vTreatmentCreate.arterialPressureLimitLow = lowValue - _flickable.setInteractive(true) - } - onHighSliderPressed: { - _flickable.setInteractive(false) - vTreatmentCreate.arterialPressureLimitHigh = highValue - } - onHighSliderReleased: { - vTreatmentCreate.arterialPressureLimitHigh = highValue - _flickable.setInteractive(true) - } } - Text { id: _venousPressureLimitsTitle - text: qsTr("Venous Pressure Limits") - anchors.left: _venousPressureLimits.left - font.pixelSize: Fonts.fontPixelFluidText - color: Colors.textMain; + Column { id: _venousColumn + spacing: 45 + anchors.horizontalCenter: parent.horizontalCenter + Text { id: _venousLabel + visible : true + color : "white" + text: qsTr("Venous Pressure Limits") + " " + "(" + Variables.unitTextBloodPressure + ")" + font.pixelSize : Fonts.fontPixelFluidText + anchors.left : _venousPressureLimits.left + } + RangeSlider { id: _venousPressureLimits + // dimension + height : 5 + width : Variables.createTreatmentSliderWidth + diameter : Variables.sliderCircleDiameter + anchors.horizontalCenter: parent.horizontalCenter + ticks : true + stepSnap : true + hasAdjusted : true - } + // Texts + lowerText.visible : true + lowerText.font.pixelSize : Fonts.fontPixelFluidText + lowerText.font.bold : false + lowerText.anchors.topMargin : -50 + lowerTextHorizontalCenter : true - SliderDoubleCreateTreatment { id: _venousPressureLimits - objectName: "_venousPressureLimits" - lowSliderObjectName: objectName + "LowSlider" - lowSelectedValueObjectName: objectName + "LowValue" - highSliderObjectName: objectName + "HighSlider" - highSelectedValueObjectName: objectName + "HighValue" - lowTitle: qsTr("Low") - lowUnits: Variables.unitTextBloodPressure - highTitle: qsTr("High") - highUnits: Variables.unitTextBloodPressure - lowMin: vTreatmentCreate.venousPressureLimitLowMin - lowMax: vTreatmentCreate.venousPressureLimitLowMax - highMin: vTreatmentCreate.venousPressureLimitHighMin - highMax: vTreatmentCreate.venousPressureLimitHighMax - lowValue: vTreatmentCreate.venousPressureLimitLowMin - highValue: vTreatmentCreate.venousPressureLimitHighMin - lowStep: vTreatmentCreate.venousPressureLimitLowRes - highStep: vTreatmentCreate.venousPressureLimitHighRes - onLowSliderPressed: { - _flickable.setInteractive(false) - vTreatmentCreate.venousPressureLimitLow = lowValue + upperText.visible : true + upperText.font.pixelSize : Fonts.fontPixelFluidText + upperText.font.bold : false + upperText.anchors.topMargin : -50 + upperTextHorizontalCenter : true + + minText.visible : true + // minText.font.pixelSize : Fonts.fontPixelFluidText + minText.font.bold : false + minVerticalEdgeVisible : false + + maxText.visible : true + // maxText.font.pixelSize : Fonts.fontPixelFluidText + maxText.font.bold : false + maxVerticalEdgeVisible : false + + // Ranges + step : Variables.arterialLimitStep + gapValue : Variables.arterialLimitGap + minimum : vTreatmentCreate.venousPressureLimitLowMin + maximum : vTreatmentCreate.venousPressureLimitHighMax + minValue : vTreatmentCreate.venousPressureLimitLowMin + maxValue : vTreatmentCreate.venousPressureLimitHighMax + minValueLowerBound : vTreatmentCreate.venousPressureLimitLowMin + minValueUpperBound : vTreatmentCreate.venousPressureLimitLowMax + maxValueLowerBound : vTreatmentCreate.venousPressureLimitHighMin + maxValueUpperBound : vTreatmentCreate.venousPressureLimitHighMax + // scroll handling and value updates + onPressed : { setInteractive(false) } + onDragged : { setInteractive(false) } + onReleased: { setInteractive(true ) } + onMinValueChanged: if (minAdjusted) vTreatmentCreate.venousPressureLimitLow = minValue + onMaxValueChanged: if (maxAdjusted) vTreatmentCreate.venousPressureLimitHigh = maxValue } - onLowSliderReleased: { - vTreatmentCreate.venousPressureLimitLow = lowValue - _flickable.setInteractive(true) - } - onHighSliderPressed: { - _flickable.setInteractive(false) - vTreatmentCreate.venousPressureLimitHigh = highValue - } - onHighSliderReleased: { - vTreatmentCreate.venousPressureLimitHigh = highValue - _flickable.setInteractive(true) - } } SliderCreateTreatment { id: _bloodPressureMeasurementInterval @@ -374,7 +411,7 @@ step: vTreatmentCreate.bloodPressureMeasureIntervalRes stepSnap: true onPressed: { - _flickable.setInteractive(false) + setInteractive(false) vTreatmentCreate.bloodPressureMeasureInterval = value vVitals.doUpdateBPMeasureInterval(value) } @@ -396,12 +433,12 @@ step: vTreatmentCreate.rinsebackFlowRateRes stepSnap: true onPressed: { - _flickable.setInteractive(false) + setInteractive(false) vTreatmentCreate.rinsebackFlowRate = value } onReleased: { vTreatmentCreate.rinsebackFlowRate = value - _flickable.setInteractive(true) + setInteractive(true) } } @@ -434,7 +471,7 @@ Rectangle { id: _spacer - height: 75 + height: 15 width: parent.width color: "transparent" } @@ -453,7 +490,6 @@ _continueRect.toggleEnabled(true) } else { _continueRect.toggleEnabled(false) - } } @@ -496,10 +532,10 @@ _dialyzerType .setValid (true) _dialysateTemperature .setValid (true) - _arterialPressureLimits .setLowValid (true) - _arterialPressureLimits .setHighValid(true) - _venousPressureLimits .setLowValid (true) - _venousPressureLimits .setHighValid(true) + // _arterialPressureLimits .setLowValid (true) + // _arterialPressureLimits .setHighValid(true) + // _venousPressureLimits .setLowValid (true) + // _venousPressureLimits .setHighValid(true) _bloodPressureMeasurementInterval .setValid (true) _rinsebackFlowRate .setValid (true) } @@ -581,51 +617,51 @@ let newContentY = 0; if (parameter === prefix+"bloodFlowRate") { - newContentY = _bloodFlowRate.mapToItem(_bloodFlowRate.parent, 0, 0).y; + newContentY = _bloodFlowRate.mapToItem(_bloodFlowRate.parent, 0, 0).y; } else if (parameter === prefix+"dialysateFlowRate") { - newContentY = _dialysateFlowRate.mapToItem(_dialysateFlowRate.parent, 0, 0).y; + newContentY = _dialysateFlowRate.mapToItem(_dialysateFlowRate.parent, 0, 0).y; } else if (parameter === prefix+"duration") { - newContentY = _duration.mapToItem(_duration.parent, 0, 0).y; + newContentY = _duration.mapToItem(_duration.parent, 0, 0).y; } else if (parameter === prefix+"heparinDispensingRate") { - newContentY = _heparinDispensingRate.mapToItem(_heparinDispensingRate.parent, 0, 0).y; + newContentY = _heparinDispensingRate.mapToItem(_heparinDispensingRate.parent, 0, 0).y; } else if (parameter === prefix+"heparinBolusVolume") { - newContentY = _heparinBolusVolume.mapToItem(_heparinBolusVolume.parent, 0, 0).y; + newContentY = _heparinBolusVolume.mapToItem(_heparinBolusVolume.parent, 0, 0).y; } else if (parameter === prefix+"heparinStopTime") { - newContentY = _heparinStopTime.mapToItem(_heparinStopTime.parent, 0, 0).y; + newContentY = _heparinStopTime.mapToItem(_heparinStopTime.parent, 0, 0).y; } else if (parameter === prefix+"salineBolus") { - newContentY = _salineBolus.mapToItem(_salineBolus.parent, 0, 0).y; + newContentY = _salineBolus.mapToItem(_salineBolus.parent, 0, 0).y; } else if (parameter === prefix+"acidConcentrate") { - newContentY = _acidConcentrate.mapToItem(_acidConcentrate.parent, 0, 0).y; + newContentY = _acidConcentrate.mapToItem(_acidConcentrate.parent, 0, 0).y; } else if (parameter === prefix+"bicarbonateConcentrate") { - newContentY = _bicarbonateConcentrate.mapToItem(_bicarbonateConcentrate.parent, 0, 0).y; + newContentY = _bicarbonateConcentrate.mapToItem(_bicarbonateConcentrate.parent, 0, 0).y; } else if (parameter === prefix+"dialyzerType") { - newContentY = _dialyzerType.mapToItem(_dialyzerType.parent, 0, 0).y; + newContentY = _dialyzerType.mapToItem(_dialyzerType.parent, 0, 0).y; } else if (parameter === prefix+"dialysateTemp") { - newContentY = _dialysateTemperature.mapToItem(_dialysateTemperature.parent, 0, 0).y; + newContentY = _dialysateTemperature.mapToItem(_dialysateTemperature.parent, 0, 0).y; } else if (parameter === prefix+"arterialPressureLimitLow" || parameter === prefix+"arterialPressureLimitHigh") { - newContentY = _arterialPressureLimits.mapToItem(_arterialPressureLimits.parent, 0, 0).y; + newContentY = _arterialPressureLimits.mapToItem(_arterialPressureLimits.parent, 0, 0).y; } else if (parameter === prefix+"venousPressureLimitLow" || parameter === prefix+"venousPressureLimitHigh") { - newContentY = _venousPressureLimits.mapToItem(_venousPressureLimits.parent, 0, 0).y; + newContentY = _venousPressureLimits.mapToItem(_venousPressureLimits.parent, 0, 0).y; } else if (parameter === prefix+"bloodPressureMeasureInterval") { - newContentY = _bloodPressureMeasurementInterval.mapToItem(_bloodPressureMeasurementInterval.parent, 0, 0).y; + newContentY = _bloodPressureMeasurementInterval.mapToItem(_bloodPressureMeasurementInterval.parent, 0, 0).y; } else if (parameter === prefix+"rinsebackFlowRate") { - newContentY = _rinsebackFlowRate.mapToItem(_rinsebackFlowRate.parent, 0, 0).y; + newContentY = _rinsebackFlowRate.mapToItem(_rinsebackFlowRate.parent, 0, 0).y; } else { return;