Index: sources/gui/qml/components/RangeRect.qml =================================================================== diff -u -r51c8036de03623725353aad8e913b32804e93b5e -r9419d09af625fa3b1291da079df2df0589358ff6 --- sources/gui/qml/components/RangeRect.qml (.../RangeRect.qml) (revision 51c8036de03623725353aad8e913b32804e93b5e) +++ sources/gui/qml/components/RangeRect.qml (.../RangeRect.qml) (revision 9419d09af625fa3b1291da079df2df0589358ff6) @@ -44,25 +44,18 @@ 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 - } - + function adjustOverlap() { // Due to font size not being fixed and be different depending on text, // setting a minimal expected gap - let minimumGap = 10 + let minimumGap = 4 let overlap = _textMinimum.x + _textMinimum.width - _textMaximum.x + minimumGap + // Check if there exists an overlap, if there is an overlap, adjust the text padding + // to provide a gap between the min and max text labels. Otherwise, set them to 0 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 } @@ -76,14 +69,12 @@ Text { id: _textMinimum visible : false - - onTextChanged: ajustOverlap() - font.pixelSize : Fonts.fontPixelRangeRectText font.bold : true color : Colors.textProgressBar text : minimum.toFixed(decimal) + unit + onTextChanged : adjustOverlap() anchors { left : parent.left @@ -101,8 +92,8 @@ color : Colors.textProgressBar text : maximum.toFixed(decimal) + unit + onTextChanged : adjustOverlap() - onTextChanged: ajustOverlap() anchors { right : parent.right top : parent.bottom