Index: sources/gui/qml/components/RangeSlider.qml =================================================================== diff -u -r0f28ae04f739c859dc850a9baa430c62251629d6 -r2b16e255a35e0f716bfa9d6943b35e4199dcf3b0 --- sources/gui/qml/components/RangeSlider.qml (.../RangeSlider.qml) (revision 0f28ae04f739c859dc850a9baa430c62251629d6) +++ sources/gui/qml/components/RangeSlider.qml (.../RangeSlider.qml) (revision 2b16e255a35e0f716bfa9d6943b35e4199dcf3b0) @@ -175,6 +175,7 @@ } let mValue = setValue(x) + // console.debug( maxValue - minValue, minValue, value, maxValue ) if ( maxValue - minValue <= gapValue ) { // max correction if the values get too close together less than defined gap @@ -193,15 +194,21 @@ else checkLimitsMinValueBounds(mValue) } else { - // console.debug( minDiff, minValue, value, maxValue, maxDiff ) - if ( minDiff < maxDiff ) { - // if (minDiff > limitGap) return // not sure if it needs but kept it as an idea. - checkLimitsMinValueBounds(mValue) + if ( minAdjusted && maxAdjusted ) { + // min and max have been adjust initially + if ( minDiff < maxDiff ) { + // if (minDiff > limitGap) return // not sure if it needs but kept it as an idea. + checkLimitsMinValueBounds(mValue) + } + else { + // if (maxDiff > limitGap) return // not sure if it needs but kept it as an idea. + checkLimitsMaxValueBounds(mValue) + } + } else { + // if only one handle side is selected, adjust according to the selected + if ( curHandler === RangeSlider.HandlerOption.Max ) checkLimitsMaxValueBounds(mValue) + if ( curHandler === RangeSlider.HandlerOption.Min ) checkLimitsMinValueBounds(mValue) } - else { - // if (maxDiff > limitGap) return // not sure if it needs but kept it as an idea. - checkLimitsMaxValueBounds(mValue) - } } } @@ -254,13 +261,13 @@ // so it has to be implemented here as well onDragged: { // Add in the x position of the range rect to account for it moving on the - // main slider line + // main slider line and the displacement of the touch margin increase setBound(vMouseEvent.x + _rangeRect.x - _rangeRect.leftRightTouchMargin) } onReleased: { // Add in the x position of the range rect to account for it moving on the - // main slider line + // main slider line and the displacement of the touch margin increase setBound(vMouseEvent.x + _rangeRect.x - _rangeRect.leftRightTouchMargin) } } @@ -282,10 +289,12 @@ } onDragged: { + // Need to account for the extended touch areas setBound(vMouseEvent.x - _rangeRect.leftRightTouchMargin) } onReleased: { + // Need to account for the extended touch areas setBound(vMouseEvent.x - _rangeRect.leftRightTouchMargin) } @@ -326,7 +335,7 @@ width : 4 color : Colors.textMain } - MouseArea { + MouseArea { id: _leftHandleMouseArea propagateComposedEvents: true // propagate the click to the lower layer anchors.fill: parent onPressed: { @@ -356,9 +365,10 @@ width : 4 color : Colors.textMain } - MouseArea { + MouseArea { id: _rightHandlerMouseArea propagateComposedEvents: true // propagate the click to the lower layer anchors.fill: parent + onPressed:{ mouse.accepted = false // indicate that the current component did not handle the mouse action, propagate _root.curHandler = RangeSlider.HandlerOption.Max