Index: sources/gui/qml/components/RangeSlider.qml =================================================================== diff -u -r605815f54dfac948ada786080f55d1b6e7a0d47b -r9a0581274e4dc51af6d6f3e4dd932581e8dce445 --- sources/gui/qml/components/RangeSlider.qml (.../RangeSlider.qml) (revision 605815f54dfac948ada786080f55d1b6e7a0d47b) +++ sources/gui/qml/components/RangeSlider.qml (.../RangeSlider.qml) (revision 9a0581274e4dc51af6d6f3e4dd932581e8dce445) @@ -34,10 +34,14 @@ Max } + property alias lowerText : _rangeRect.minText + property alias upperText : _rangeRect.maxText + property alias minValue : _rangeRect.lowerBound ///< value of the minimum slider handler property alias maxValue : _rangeRect.upperBound ///< value of the maximum slider handler property int curHandler : RangeSlider.HandlerOption.None ///< current active slider handler + property int diameter : Variables.progressbarHandler ///< handlers diameter property real step : 1 ///< each step difference property bool stepSnap : false ///< values within steps are not selectable if true @@ -95,6 +99,10 @@ return ( x * ( maximum - minimum ) ) / width + minimum } + function getXOfValue(vValue) { + return ((vValue - minimum) * width)/( maximum - minimum ) + } + /// /// \brief calculate the value by position x of the handler /// \details calculates the current value withing the range of minimum and maximum regarding the x cordinate of the active slider. @@ -164,10 +172,13 @@ decimal: _root.decimal minText { - visible: true - anchors.topMargin: -25 + visible: false + anchors.topMargin: -40 } - maxText.visible: true + maxText { + visible: false + anchors.topMargin: -40 + } // propagation is not working on drag ! // so it has to be implemented here as well @@ -226,7 +237,7 @@ /// Left most handler Rectangle { id: _handlerLeft - property real diameter : Variables.progressbarHandler + property real diameter : _root.diameter anchors.verticalCenter : parent.verticalCenter anchors.horizontalCenter: _rangeRect.left @@ -243,7 +254,7 @@ /// Right most handler Rectangle { id: _handlerRight - property real diameter : Variables.progressbarHandler + property real diameter : _root.diameter anchors.verticalCenter : parent.verticalCenter anchors.horizontalCenter : _rangeRect.right