Index: sources/gui/qml/components/RangeBar.qml =================================================================== diff -u -r56e378f7504701b9e9a9dccaf205aef2fd52c58e -r9d8a60eb984003d3f7814cbe507b1b37f519bc80 --- sources/gui/qml/components/RangeBar.qml (.../RangeBar.qml) (revision 56e378f7504701b9e9a9dccaf205aef2fd52c58e) +++ sources/gui/qml/components/RangeBar.qml (.../RangeBar.qml) (revision 9d8a60eb984003d3f7814cbe507b1b37f519bc80) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file RangeBar.qml - * \author (last) Behrouz NemaiPour - * \date (last) 04-Jun-2020 + * \author (last) Behrouz NematiPour + * \date (last) 16-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 27-Jan-2020 * @@ -33,15 +33,19 @@ property alias rangebar : _rangeRect property int markerHeight: Variables.rangeMarkerHeightMidle - property color markerColor : Colors.rangeMarker + property color markerColor : markerOutRangeNotify ? (value >= lowerBound && value <= upperBound ? Colors.rangeMarker : Colors.red) : Colors.rangeMarker + property bool markerOutRangeNotify: false + property bool markerVisible : true property int markerBoundHeight : Variables.rangeMarkerHeightShort property color markerBoundColor : Colors.rangeMarkerShort + property int markerFontSize : Fonts.fontPixelRangeMarker - property bool minTextHorizontalCenter: true - property bool maxTextHorizontalCenter: true + property bool lowerTextHorizontalCenter: true + property bool upperTextHorizontalCenter: true RangeRect { id: _rangeRect + color: "red" x : ((parent.width * (lowerBound - parent.minimum)) / (parent.maximum - parent.minimum)) height : parent.height width : ((parent.width * (upperBound - lowerBound)) / (parent.maximum - parent.minimum)) @@ -53,9 +57,10 @@ minText.visible: true maxText.visible: true - minText.anchors.leftMargin : minTextHorizontalCenter ? -minText.width / 2 : 0 - maxText.anchors.rightMargin : maxTextHorizontalCenter ? -maxText.width / 2 : 0 + minText.anchors.leftMargin : lowerTextHorizontalCenter ? -minText.width / 2 : 0 + maxText.anchors.rightMargin : upperTextHorizontalCenter ? -maxText.width / 2 : 0 + RangeMarker { id: _rangeMarkerLowerBound decimal : _root.decimal text.visible: false @@ -71,13 +76,16 @@ color : markerBoundColor anchors.left: parent.right } + onClicked: _root.clicked(vMouseEvent) } RangeMarker { id: _rangeMarkerValue + visible: _root.markerVisible decimal: _root.decimal value : parent.value x : ((parent.width * (parent.value - minimum)) / (maximum - minimum)) text.visible: true + text.font.pixelSize: _root.markerFontSize hasHandle : true height : markerHeight color : markerColor