Index: sources/gui/qml/components/Slider.qml =================================================================== diff -u -r76d4131d70c18cbfaf47c242c17258e80161e8dc -r38cb7a4ff6d12878d078fb10c8d6915a31dc1df9 --- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 76d4131d70c18cbfaf47c242c17258e80161e8dc) +++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 38cb7a4ff6d12878d078fb10c8d6915a31dc1df9) @@ -42,6 +42,8 @@ property bool isActive : true property alias progressRectMargin : _progressRect.margin + property int tickMarksThickness : 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.tickMarksThickness + } else + if ( _progressRect.width >= _root.width - _root.tickMarksThickness ) { + _handler.x = _root.width - _handler.width + _root.tickMarksThickness + } + else { + _handler.x = _progressRect.width - _handler.width / 2 + } + } + ProgressRect { id: _progressRect color : Colors.highlightProgressBar decimal : _root.decimal @@ -143,6 +157,10 @@ setValue(vMouseEvent.x) _root.released(vMouseEvent) } + onWidthChanged: { + // TODO: DEN-5603 : Still has some issues on high resolution sliders [ handler jumps to the 0 ]. + // setHandlerPosition() + } } // used loader for performance since it may not always be required. @@ -151,7 +169,7 @@ active : ticks anchors.fill : parent sourceComponent : TickMarks { - thickness : 2 + thickness : _root.tickMarksThickness decimal : _root.decimal minimum : _root.minimum maximum : _root.maximum