Index: sources/gui/qml/components/RangeSlider.qml =================================================================== diff -u -r642f08650a7a88ad6a2305fdea6bd18365aab5c7 -r7ed22fc4ad6b61ea9a502f3e2eeca6d10fb0699d --- sources/gui/qml/components/RangeSlider.qml (.../RangeSlider.qml) (revision 642f08650a7a88ad6a2305fdea6bd18365aab5c7) +++ sources/gui/qml/components/RangeSlider.qml (.../RangeSlider.qml) (revision 7ed22fc4ad6b61ea9a502f3e2eeca6d10fb0699d) @@ -74,8 +74,8 @@ property bool isRoundedEnds : true property bool hasBorder : true - property color disabledBorderColor : Colors.borderDisableButton - property color enabledBorderColor : Colors.borderButton + property color disabledBorderColor : Colors.borderDisableButton + property color enabledBorderColor : Colors.borderButton onHasAdjustChanged : { setAdjusted() @@ -384,8 +384,8 @@ return _root.tickMarkYDisplacement } } - showEndMarks : true - color: _root.isActive ? Colors.borderButton : Colors.borderDisableButton + showEndMarks : !_root.isTickMarksCentered + color: (_root.minAdjusted && _root.maxAdjusted) ? enabledBorderColor : disabledBorderColor } } Index: sources/gui/qml/components/Slider.qml =================================================================== diff -u -r798ce1a491cd43a3a24fb96f930d4c316add1ff1 -r7ed22fc4ad6b61ea9a502f3e2eeca6d10fb0699d --- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 798ce1a491cd43a3a24fb96f930d4c316add1ff1) +++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 7ed22fc4ad6b61ea9a502f3e2eeca6d10fb0699d) @@ -47,7 +47,9 @@ property alias progressRectMargin : _progressRect.margin - property int tickMarksThickness : 2 + property int tickMarksThickness : 2 + property bool isTickMarksCentered : false ///< Indicate whether the tickmarks are centered in the slider body + property int tickMarkYDisplacement : (-_handler.height/2 - _handler.border.width*2) ///< The amount of y displacement if the TickMarks are not centered property bool isRoundedEnds : true property bool hasBorder : true @@ -213,26 +215,6 @@ return mValue; } - // used loader for performance since it may not always be required. - // and can be a heavy Component - Loader { id: _ticksLoader - active : ticks - anchors.fill : parent - sourceComponent : TickMarks { - decimal : _root.decimal - minimum : _root.minimum - maximum : _root.maximum - step : _root.step - stepSnap : _root.stepSnap - textColor : _root.color - lineTickMarkHeight : _progressRect.height - lineTickMarkThickness : _root.tickMarksThickness - isTickMarkRound : _root.isRoundedEnds - yDisplacement : _root.isRoundedEnds ? (-_handler.height/2 - _handler.border.width/2) : 0 - color : _root.isActive ? Colors.borderButton : Colors.borderDisableButton - } - } - ProgressRect { id: _progressRect property real previousSliderValue: Number.NaN value : _root.value @@ -260,6 +242,35 @@ } } + // used loader for performance since it may not always be required. + // and can be a heavy Component + Loader { id: _ticksLoader + active : ticks + width : _root.width + height : (_progressRect.height - Variables.sliderDefaultRoundTickMarkDiameter) + anchors.bottom : _root.bottom + sourceComponent : TickMarks { + decimal : _root.decimal + minimum : _root.minimum + maximum : _root.maximum + step : _root.step + stepSnap : _root.stepSnap + textColor : _root.color + lineTickMarkHeight : _progressRect.height + lineTickMarkThickness : _root.tickMarksThickness + isTickMarkRound : _root.isRoundedEnds + showEndMarks : !_root.isTickMarksCentered + yDisplacement : { + if ( _root.isTickMarksCentered ) { + return (_root.border.width/2 - 1) // had to subtract 1 to center on the _progressRect + } else { + return _root.tickMarkYDisplacement + } + } + color : _root.isActive ? Colors.borderButton : Colors.borderDisableButton + } + } + function updateHandleValue(vCurrentPositionX) { // Passing false for snapping to get exact value in respect to x Index: sources/gui/qml/pages/pretreatment/connection/PreTreatmentUltrafiltration.qml =================================================================== diff -u -r642f08650a7a88ad6a2305fdea6bd18365aab5c7 -r7ed22fc4ad6b61ea9a502f3e2eeca6d10fb0699d --- sources/gui/qml/pages/pretreatment/connection/PreTreatmentUltrafiltration.qml (.../PreTreatmentUltrafiltration.qml) (revision 642f08650a7a88ad6a2305fdea6bd18365aab5c7) +++ sources/gui/qml/pages/pretreatment/connection/PreTreatmentUltrafiltration.qml (.../PreTreatmentUltrafiltration.qml) (revision 7ed22fc4ad6b61ea9a502f3e2eeca6d10fb0699d) @@ -72,14 +72,27 @@ width : parent.width / 2 step : 0.100 stepSnap: true - ticks : false + ticks : true diameter: Variables.sliderCircleDiameter decimal : Variables.ultrafiltrationPrecision minimum : Variables.ultrafiltrationMinDef - maximum : vTreatmentRanges.treatmentRanges_Ultrafiltration_Volume_Max + maximum : 1//vTreatmentRanges.treatmentRanges_Ultrafiltration_Volume_Max minText.font.pixelSize: Fonts.fontPixelFluidText maxText.font.pixelSize: Fonts.fontPixelFluidText onPressed: isActive = true } + SliderArrows{ id:_volumeSliderSliderArrows + anchors.verticalCenter : _volumeSlider.verticalCenter + anchors.right : parent.right + anchors.rightMargin : Variables.sliderAdjustButtonRightMargin + onIncrementValue : { + _volumeSlider.isActive = true + _volumeSlider.incrementValue(true) + } + onDecrementValue : { + _volumeSlider.isActive = true + _volumeSlider.decrementValue(true) + } + } }