aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBox.qml2
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml13
2 files changed, 10 insertions, 5 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBox.qml
index 3f0d1296e5..39cd51d288 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBox.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBox.qml
@@ -71,6 +71,8 @@ T.SpinBox {
property real __sliderIndicatorWidth: StudioTheme.Values.squareComponentWidth
property real __sliderIndicatorHeight: StudioTheme.Values.height
+ property alias compressedValueTimer: myTimer
+
signal realValueModified
signal compressedRealValueModified
signal dragStarted
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml
index 7de0eb735e..243859e2d8 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml
@@ -88,6 +88,10 @@ TextInput {
// Force focus on the non visible component to receive key events
dragModifierWorkaround.forceActiveFocus()
} else {
+ if (myControl.compressedValueTimer.running) {
+ myControl.compressedValueTimer.stop()
+ calcValue(myControl.compressedRealValueModified)
+ }
mouseArea.cursorShape = Qt.PointingHandCursor // TODO
myControl.drag = false
myControl.dragEnded()
@@ -97,15 +101,14 @@ TextInput {
myControl.focus = false
}
}
- onTranslationChanged: calcValue()
- onMultiplierChanged: calcValue()
+ onTranslationChanged: calcValue(myControl.realValueModified)
+ onMultiplierChanged: calcValue(myControl.realValueModified)
- function calcValue() {
+ function calcValue(callback) {
var tmp = myControl.realDragRange / StudioTheme.Values.dragLength
var currValue = myControl.realValue
myControl.setRealValue(dragHandler.initialValue + (tmp * dragHandler.translation.x * dragHandler.multiplier))
- if (currValue !== myControl.realValue)
- myControl.realValueModified()
+ callback()
}
}