Index: sources/gui/qml/components/RangeSlider.qml =================================================================== diff -u -raac9d5d70abbd8d75c6e3782722e5daaf7355153 -r74fa9686a916c53d1549fa3733d200edb9df9d3b --- sources/gui/qml/components/RangeSlider.qml (.../RangeSlider.qml) (revision aac9d5d70abbd8d75c6e3782722e5daaf7355153) +++ sources/gui/qml/components/RangeSlider.qml (.../RangeSlider.qml) (revision 74fa9686a916c53d1549fa3733d200edb9df9d3b) @@ -118,6 +118,19 @@ font.bold : false } + function incrementMax(vInStepSegments) { + updateMaxValue(vInStepSegments, true) + } + function decrementMax(vInStepSegments) { + updateMaxValue(vInStepSegments, false) + } + + function incrementMin(vInStepSegments) { + updateMinValue(vInStepSegments, true) + } + function decrementMin(vInStepSegments) { + updateMinValue(vInStepSegments, false) + } /// /// \brief grays out the rangebar and handler if not adjusted and hasAdjust set to true /// @@ -218,7 +231,7 @@ function checkLimitsMinValueBounds ( vValue ) { if ( vValue < minValueLowerBound ) { minValue = minValueLowerBound; return } if ( vValue > minValueUpperBound ) { minValue = minValueUpperBound; return } - setMinvalue(vValue) + setMinValue(vValue) } function checkLimitsMaxValueBounds ( vValue ) { @@ -227,7 +240,7 @@ setMaxValue(vValue) } - function setMinvalue(vValue) { + function setMinValue(vValue) { minAdjusted = true minValue = vValue } @@ -237,6 +250,38 @@ maxValue = vValue } + // This is a helper function that will calculate and return a new value + // that was either incremented or decremented by 1 or step amount + function determineNewValue(vOldValue, vInStepSegments, vIsIncrementing) { + let amountChanged = 1 + if (vInStepSegments) { + amountChanged = step + } + + let newValue = Number.NaN + if(vIsIncrementing) { + newValue = vOldValue + amountChanged + } else { + newValue = vOldValue - amountChanged + } + + // Capping values based on min/max threshold + if ( newValue < minimum ) newValue = minimum + if ( newValue > maximum ) newValue = maximum + + return newValue.toFixed(decimal) + } + + function updateMaxValue(vInStepSegments, vIsIncrementing) { + let newMaxValue = determineNewValue(_root.maxValue, vInStepSegments, vIsIncrementing) + setMaxValue(newMaxValue) + } + + function updateMinValue(vInStepSegments, vIsIncrementing) { + let newMinValue = determineNewValue(_root.minValue, vInStepSegments, vIsIncrementing) + setMinValue(newMinValue) + } + /// The main range rectangle bar - This is the "highlighted" area of the slider RangeRect { id: _rangeRect property alias lowerBound : _rangeRect.minimum Index: sources/gui/qml/components/TextRect.qml =================================================================== diff -u -rc9f8f8cf3c6c37fc6460d8675c62c9442c4d4263 -r74fa9686a916c53d1549fa3733d200edb9df9d3b --- sources/gui/qml/components/TextRect.qml (.../TextRect.qml) (revision c9f8f8cf3c6c37fc6460d8675c62c9442c4d4263) +++ sources/gui/qml/components/TextRect.qml (.../TextRect.qml) (revision 74fa9686a916c53d1549fa3733d200edb9df9d3b) @@ -36,6 +36,8 @@ property alias labelHeight : _labelText.height property alias labelFont : _labelText.font + property alias extraLabelPixelSize : _extraText.font.pixelSize + property string extra : "" property string extraColor : Colors.textTextRectExtra Index: sources/gui/qml/compounds/PressureRangeSlider.qml =================================================================== diff -u -raac9d5d70abbd8d75c6e3782722e5daaf7355153 -r74fa9686a916c53d1549fa3733d200edb9df9d3b --- sources/gui/qml/compounds/PressureRangeSlider.qml (.../PressureRangeSlider.qml) (revision aac9d5d70abbd8d75c6e3782722e5daaf7355153) +++ sources/gui/qml/compounds/PressureRangeSlider.qml (.../PressureRangeSlider.qml) (revision 74fa9686a916c53d1549fa3733d200edb9df9d3b) @@ -52,7 +52,7 @@ step : minimum space/movement between each range slider values \endverbatim */ -Row { id: _root +Item { id: _root property real minimum : 0 ///< the minimum value of the range (adjustable slider might be different regarding the minimumMargin) property real minimumMargin : 0 ///< the margin of the adjustable minimum value from the minimm property real lowerBoundMin : 0 ///< the adjutable lowerband minimum acceptable value @@ -72,27 +72,36 @@ property string titleText : "" ///< the component title property string titleUnit : Variables.unitTextBloodPressure ///< the component unit property int titleFontSize : Fonts.fontPixelPresseuresLabel ///< the component title font size - property int titleWidth : 200 ///< the component title width + property int titleWidth : 150 ///< the component title width property int progressWidth : Variables.pressuresProgressbarWidth ///< rangebar width property color progressColor : Colors.highlightProgressBar ///< rangebar color property int sliderTopMargin : 100 ///< top margin between the slider and the rangebar - spacing: 25 + width : parent.width + height : 200 TextRect { id: _pressureTextRect anchors.top: parent.top + height:50 width: titleWidth - label: _root.titleText + title: _root.titleText extra: _root.titleUnit + labelFont.weight: Font.ExtraLight labelFont.pixelSize: _root.titleFontSize + extraLabelPixelSize: 20 + anchors.left: parent.left + anchors.leftMargin: 30 } Rectangle { id: _pressureRect + anchors.top: parent.top + anchors.topMargin: _pressureTextRect.height + anchors.left: parent.left + anchors.leftMargin: _maxHandleArrows.width + _pressureSlider.maxText.width width : _root.progressWidth - height: 10 - color: Colors.transparent + color : Colors.transparent property int minMargin: _root.minimumMargin property int maxMargin: _root.maximumMargin @@ -202,5 +211,21 @@ upperBound = maxValue } } + + SliderArrows{ id:_maxHandleArrows + anchors.verticalCenter : _pressureSlider.verticalCenter + anchors.left : _pressureRangeBar.right + anchors.leftMargin : Variables.sliderAdjustButtonLeftMargin + _pressureSlider.maxText.width + onIncrementValue : _pressureSlider.incrementMax(true) + onDecrementValue : _pressureSlider.decrementMax(true) + } + + SliderArrows{ id:_minHandleArrows + anchors.verticalCenter : _pressureSlider.verticalCenter + anchors.right : _pressureRangeBar.left + anchors.rightMargin : 10 + onIncrementValue : _pressureSlider.incrementMin(true) + onDecrementValue : _pressureSlider.decrementMin(true) + } } } Index: sources/gui/qml/globals/Fonts.qml =================================================================== diff -u -r828e0b187e2fa3f75d769938bede41ef34683493 -r74fa9686a916c53d1549fa3733d200edb9df9d3b --- sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision 828e0b187e2fa3f75d769938bede41ef34683493) +++ sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision 74fa9686a916c53d1549fa3733d200edb9df9d3b) @@ -47,7 +47,7 @@ readonly property int fontPixelStepNormal : 14 readonly property int fontPixelPresseuresText : 22 - readonly property int fontPixelPresseuresLabel : 34 + readonly property int fontPixelPresseuresLabel : 30 readonly property int fontPixelFluidText : 22 readonly property int fontPixelFluidValue : 32 Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentPressuresLimits.qml =================================================================== diff -u -raac9d5d70abbd8d75c6e3782722e5daaf7355153 -r74fa9686a916c53d1549fa3733d200edb9df9d3b --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentPressuresLimits.qml (.../TreatmentAdjustmentPressuresLimits.qml) (revision aac9d5d70abbd8d75c6e3782722e5daaf7355153) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentPressuresLimits.qml (.../TreatmentAdjustmentPressuresLimits.qml) (revision 74fa9686a916c53d1549fa3733d200edb9df9d3b) @@ -48,45 +48,47 @@ titleText: qsTr("PRESSURES") - Column { id : _pressuresColumn - spacing: 100 - anchors.centerIn: parent - PressureRangeSlider { id: _arterialPressure - titleText : qsTr("Arterial") - anchors.horizontalCenter: parent.horizontalCenter - progressColor : Colors.pressuresArterialBar + PressureRangeSlider { id: _arterialPressure + titleText : qsTr("Arterial") + anchors.horizontalCenter: parent.horizontalCenter + progressColor : Colors.pressuresArterialBar + minimumMargin : Math.abs(vTreatmentRanges.arterialPressureMonitorMin - vTreatmentRanges.arterialPressureLimitLowMin ) + lowerBoundMin : vTreatmentRanges.arterialPressureLimitLowMin + lowerBoundMax : vTreatmentRanges.arterialPressureLimitLowMax + upperBoundMin : vTreatmentRanges.arterialPressureLimitHighMin + upperBoundMax : vTreatmentRanges.arterialPressureLimitHighMax + maximumMargin : Math.abs(vTreatmentRanges.arterialPressureMonitorMax - vTreatmentRanges.arterialPressureLimitHighMax) + limitGap : vTreatmentRanges.arterialPressureLimitLowGap // currently min & max are on the same slider/scale so used min as the main res + step : arterialPressureStep + ticksVisible : true + anchors.top:parent.top + anchors.topMargin: 200 + anchors.left : parent.left + } - minimumMargin : Math.abs(vTreatmentRanges.arterialPressureMonitorMin - vTreatmentRanges.arterialPressureLimitLowMin ) - lowerBoundMin : vTreatmentRanges.arterialPressureLimitLowMin - lowerBoundMax : vTreatmentRanges.arterialPressureLimitLowMax - upperBoundMin : vTreatmentRanges.arterialPressureLimitHighMin - upperBoundMax : vTreatmentRanges.arterialPressureLimitHighMax - maximumMargin : Math.abs(vTreatmentRanges.arterialPressureMonitorMax - vTreatmentRanges.arterialPressureLimitHighMax) - limitGap : vTreatmentRanges.arterialPressureLimitLowGap // currently min & max are on the same slider/scale so used min as the main res - step : arterialPressureStep - ticksVisible : true - } + Line { id: _divider + anchors.horizontalCenter: parent.horizontalCenter + length : _root.width - 100 + color : Colors.separatorLine + anchors.top: _arterialPressure.bottom + anchors.topMargin: 25 + } - Line { - anchors.horizontalCenter: parent.horizontalCenter - length : _root.width - 100 - color : Colors.separatorLine - } - - PressureRangeSlider { id: _venousPressure - titleText : qsTr("Venous") - anchors.horizontalCenter: parent.horizontalCenter - progressColor : Colors.pressuresVenousBar - - minimumMargin : Math.abs(vTreatmentRanges.venousPressureMonitorMin - vTreatmentRanges.venousPressureLimitLowMin ) - lowerBoundMin : vTreatmentRanges.venousPressureLimitLowMin - lowerBoundMax : vTreatmentRanges.venousPressureLimitLowMax - upperBoundMin : vTreatmentRanges.venousPressureLimitHighMin - upperBoundMax : vTreatmentRanges.venousPressureLimitHighMax - maximumMargin : Math.abs(vTreatmentRanges.venousPressureMonitorMax - vTreatmentRanges.venousPressureLimitHighMax) - limitGap : vTreatmentRanges.venousPressureLimitLowGap // currently min & max are on the same slider/scale so used min as the main res - step : venousPressureStep - ticksVisible : true - } + PressureRangeSlider { id: _venousPressure + titleText : qsTr("Venous") + anchors.horizontalCenter: parent.horizontalCenter + progressColor : Colors.pressuresVenousBar + minimumMargin : Math.abs(vTreatmentRanges.venousPressureMonitorMin - vTreatmentRanges.venousPressureLimitLowMin ) + lowerBoundMin : vTreatmentRanges.venousPressureLimitLowMin + lowerBoundMax : vTreatmentRanges.venousPressureLimitLowMax + upperBoundMin : vTreatmentRanges.venousPressureLimitHighMin + upperBoundMax : vTreatmentRanges.venousPressureLimitHighMax + maximumMargin : Math.abs(vTreatmentRanges.venousPressureMonitorMax - vTreatmentRanges.venousPressureLimitHighMax) + limitGap : vTreatmentRanges.venousPressureLimitLowGap // currently min & max are on the same slider/scale so used min as the main res + step : venousPressureStep + ticksVisible : true + anchors.top : _divider.bottom + anchors.topMargin : 25 + anchors.left: parent.left } }