Index: sources/gui/qml/components/RangeRect.qml =================================================================== diff -u -r43ffdd5ca0998f06d28b6adeee231a6eec7e7150 -r1e091935c09e8f4a8b99efaab84c664ffdcf6a26 --- sources/gui/qml/components/RangeRect.qml (.../RangeRect.qml) (revision 43ffdd5ca0998f06d28b6adeee231a6eec7e7150) +++ sources/gui/qml/components/RangeRect.qml (.../RangeRect.qml) (revision 1e091935c09e8f4a8b99efaab84c664ffdcf6a26) @@ -44,6 +44,32 @@ property real touchMargin : 0 property real leftRightTouchMargin: 0 + function ajustOverlap() { + + if(minimum === maximum) { + // Same value, purposely overlap them completely + _textMinimum.rightPadding = 0 + _textMaximum.leftPadding = 0 + return + } + + // Due to font size not being fixed and be different depending on text, + // setting a minimal expected gap + let minimumGap = 10 + let overlap = _textMaximum.x + _textMinimum.width - _textMaximum.x + minimumGap + + if(overlap > 0){ + // need to ajust text padding to provide gap between min and max text labels + _textMinimum.rightPadding = overlap / 2 + _textMaximum.leftPadding = overlap / 2 + + } else { + // No overlap, set padding to 0 + _textMinimum.rightPadding = 0 + _textMaximum.leftPadding = 0 + } + } + width : parent.width height : parent.height @@ -53,6 +79,8 @@ Text { id: _textMinimum visible : false + onTextChanged: ajustOverlap() + font.pixelSize : Fonts.fontPixelRangeRectText font.bold : true @@ -76,6 +104,7 @@ color : Colors.textProgressBar text : maximum.toFixed(decimal) + unit + onTextChanged: ajustOverlap() anchors { right : parent.right top : parent.bottom