Index: leahi.qrc =================================================================== diff -u -r0022c3993c47e74c2d17c7f07f78fa1751a034f6 -r3d4fd15f566ef6824afdd6c35e4a0191c11f3d1b --- leahi.qrc (.../leahi.qrc) (revision 0022c3993c47e74c2d17c7f07f78fa1751a034f6) +++ leahi.qrc (.../leahi.qrc) (revision 3d4fd15f566ef6824afdd6c35e4a0191c11f3d1b) @@ -156,7 +156,6 @@ sources/gui/qml/components/LabelValue.qml sources/gui/qml/components/ArrowButton.qml sources/gui/qml/components/HeaderBar.qml - sources/gui/qml/components/StoppedSlider.qml sources/gui/qml/compounds/PressureRangeSlider.qml @@ -166,6 +165,7 @@ sources/gui/qml/compounds/TouchGrid.qml sources/gui/qml/compounds/BPHREntry.qml sources/gui/qml/compounds/LabelUnitContainer.qml + sources/gui/qml/compounds/StoppedSlider.qml sources/gui/qml/compounds/TreatmentAdjustmentUltrafiltrationMetrics.qml Fisheye: Tag 3d4fd15f566ef6824afdd6c35e4a0191c11f3d1b refers to a dead (removed) revision in file `sources/gui/qml/components/StoppedSlider.qml'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/gui/qml/compounds/StoppedSlider.qml =================================================================== diff -u --- sources/gui/qml/compounds/StoppedSlider.qml (revision 0) +++ sources/gui/qml/compounds/StoppedSlider.qml (revision 3d4fd15f566ef6824afdd6c35e4a0191c11f3d1b) @@ -0,0 +1,146 @@ +/*! + * + * Copyright (c) 2020-2025 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file StoppedSlider.qml + * \author (last) Stephen Quong + * \date (last) 20-Aug-2025 + * \author (original) Stephen Quong + * \date (original) 20-Aug-2025 + * + */ + +// Qt +import QtQuick 2.12 + +// Project +// Qml imports +import "qrc:/globals" +import "qrc:/components" + +/*! + * \brief Slider component with a title and the currently selected value + */ +Item { id: _root + property alias decimal : _slider.decimal + property alias minimum : _slider.minimum + property alias maximum : _slider.maximum + property alias minStop : _slider.minStop + property alias value : _slider.value + property alias defaultValue : _slider.defaultValue + property alias step : _slider.step + property string unit : "" + property bool active : false + + signal pressed () + signal released() + + function reset(vValue) { + _slider.reset(vValue) + } + + function setActiveValid() { + _root.active = true + } + + Slider { id : _slider + objectName : _root.objectName + "Slider" + anchors { + left : parent.left + right : _sliderArrows.left + rightMargin : 60 + verticalCenter : _sliderArrows.verticalCenter + } + height : Variables.ultraFiltrationProgressBarHeight + bgColor : Colors.ufAdjustmentProgressBarBg + highlightActiveColor : Colors.ufAdjustmentDeltaFill + handlerActiveColor : Colors.backgroundButtonSelect + hasBorder : false + diameter : Variables.progressbarHandler + touchMargin : Variables.createTreatmentSliderMargin + handler.z : 5 + isActive : _root.active + stepSnap : true + ticks : true + radius : 0 + onPressed : { _root.pressed () } + onReleased : { _root.released() } + onHandleSelected : { setActiveValid() } + onSliderSelected : { setActiveValid() } + minText { + font { + pixelSize : Fonts.fontPixelButton + weight : Font.Normal + } + color : Colors.progressBarMinMax + text : _root.minimum.toFixed(_root.decimal) + (_root.unit.length ? (" " + _root.unit) : "") + } + maxText { + font { + pixelSize : minText.font.pixelSize + weight : minText.font.weight + } + color : Colors.progressBarMinMax + text : _root.maximum.toFixed(_root.decimal) + (_root.unit.length ? (" " + _root.unit) : "") + } + + Rectangle { id: _removedFill + anchors { + top : parent.top + bottom : parent.bottom + left : parent.left + right : _lowMarker.right + // adjust margin so fill completely covers the underlying slider + leftMargin : -1 + } + z : _lowMarker.z - 1 + color : Colors.ufProgressBarFill + } + + RangeMarker { id: _lowMarker + x : (_slider.width * ((value - _slider.minimum) / (_slider.maximum - _slider.minimum))) - ((width+1)/2) + z : _slider.handler.z - 1 + width : Variables.ultrafiltrationRangeMarkerWidth + height : Variables.rangeMarkerHeight + hasHandle : true + valueOnTop : true + decimal : Variables.ultrafiltrationPrecision + value : Math.max(_root.minStop, _root.minimum) + handle.width : Variables.ultrafiltrationRangeMarkerHandleWidth + text { + anchors.bottomMargin: _lowMarker.valueOnTop ? 15 : 0 + font { + pixelSize: Fonts.fontPixelUltrafiltrationRangeMarker + weight: Font.DemiBold + } + } + } + } + + SliderArrows{ id:_sliderArrows + anchors { + verticalCenter : _slider.verticalCenter + right : parent.right + } + + onIncrementValue : { + if ( _slider.isActive) { + _slider.incrementValue(true) + } + else { + setActiveValid() + } + } + onDecrementValue : { + if ( _slider.isActive) { + _slider.decrementValue(true) + } + else { + setActiveValid() + } + } + } +}