Index: sources/gui/qml/components/Slider.qml =================================================================== diff -u -r76d4131d70c18cbfaf47c242c17258e80161e8dc -r4f8cbe0045e2a06a67a44894bb02b41a02eca5dd --- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 76d4131d70c18cbfaf47c242c17258e80161e8dc) +++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 4f8cbe0045e2a06a67a44894bb02b41a02eca5dd) @@ -42,6 +42,8 @@ property bool isActive : true property alias progressRectMargin : _progressRect.margin + property int tickMarksThinkness : 2 + signal progressRectClicked() signal progressRectDragged() signal activeChanged() @@ -120,6 +122,18 @@ if ( value > maximum ) { value = maximum; return; } } + function setHandlerPosition() { + if ( _progressRect.width <= 0 ) { + _handler.x = 0 - _root.tickMarksThinkness + } else + if ( _progressRect.width >= _root.width - _root.tickMarksThinkness ) { + _handler.x = _root.width - _handler.width + _root.tickMarksThinkness + } + else { + _handler.x = _progressRect.width - _handler.width / 2 + } + } + ProgressRect { id: _progressRect color : Colors.highlightProgressBar decimal : _root.decimal @@ -143,6 +157,9 @@ setValue(vMouseEvent.x) _root.released(vMouseEvent) } + onWidthChanged: { + // setHandlerPosition() + } } // used loader for performance since it may not always be required. @@ -151,7 +168,7 @@ active : ticks anchors.fill : parent sourceComponent : TickMarks { - thickness : 2 + thickness : _root.tickMarksThinkness decimal : _root.decimal minimum : _root.minimum maximum : _root.maximum