Index: sources/gui/qml/components/RangeMarker.qml =================================================================== diff -u -r3e91f569d10fe5b76298b85ee3a6875f80e33063 -r0022c3993c47e74c2d17c7f07f78fa1751a034f6 --- sources/gui/qml/components/RangeMarker.qml (.../RangeMarker.qml) (revision 3e91f569d10fe5b76298b85ee3a6875f80e33063) +++ sources/gui/qml/components/RangeMarker.qml (.../RangeMarker.qml) (revision 0022c3993c47e74c2d17c7f07f78fa1751a034f6) @@ -81,6 +81,23 @@ rightMargin : valueOnTop ? -12 : 5 topMargin : valueOnTop ? 0 : -5 horizontalCenter: valueOnTop ? _handle.horizontalCenter : undefined + horizontalCenterOffset: { + if (valueOnTop) { + if (_root.parent !== undefined) { + let xDelta = (_root.width-implicitWidth)/2 + // left boundary + if (_root.x + xDelta < 0) { + return -(_root.x + xDelta) + } + // right boundary + let rightOverflow = _root.x + _root.width - xDelta + if (rightOverflow > _root.parent.width) { + return -(rightOverflow - _root.parent.width) + } + } + } + return 0 + } } horizontalAlignment: valueOnTop ? Text.AlignHCenter : Text.AlignLeft color : _root.color