diff options
-rw-r--r-- | share/qtcreator/qmldesigner/newstateseditor/Main.qml | 14 | ||||
-rw-r--r-- | share/qtcreator/qmldesigner/newstateseditor/StateThumbnail.qml | 5 |
2 files changed, 16 insertions, 3 deletions
diff --git a/share/qtcreator/qmldesigner/newstateseditor/Main.qml b/share/qtcreator/qmldesigner/newstateseditor/Main.qml index 540f70b485..4431252ecc 100644 --- a/share/qtcreator/qmldesigner/newstateseditor/Main.qml +++ b/share/qtcreator/qmldesigner/newstateseditor/Main.qml @@ -253,6 +253,10 @@ Rectangle { property bool tinyMode: Constants.thumbnailSize <= Constants.thumbnailBreak property int currentStateInternalId: 0 + // Using an int instead of a bool, because when opening a menu on one state and without closing + // opening a menu on another state will first trigger the open of the new popup and afterwards + // the close of the old popup. Using an int keeps track of number of opened popups. + property int menuOpen: 0 // This timer is used to delay the current state animation as it didn't work due to the // repeaters item not being positioned in time resulting in 0 x and y position if the grids @@ -797,10 +801,18 @@ Rectangle { hasWhenCondition: delegateRoot.hasWhenCondition - scrollViewActive: horizontalBar.active || verticalBar.active + blockDragHandler: horizontalBar.active || verticalBar.active + || root.menuOpen dragParent: scrollView + onMenuOpenChanged: { + if (stateThumbnail.menuOpen) + root.menuOpen++ + else + root.menuOpen-- + } + // Fix ScrollView taking over the dragging event onGrabbing: { frame.interactive = false diff --git a/share/qtcreator/qmldesigner/newstateseditor/StateThumbnail.qml b/share/qtcreator/qmldesigner/newstateseditor/StateThumbnail.qml index ce95aa2198..e154bb4d39 100644 --- a/share/qtcreator/qmldesigner/newstateseditor/StateThumbnail.qml +++ b/share/qtcreator/qmldesigner/newstateseditor/StateThumbnail.qml @@ -55,7 +55,8 @@ Item { property bool hasWhenCondition: false - property bool scrollViewActive: false + property bool menuOpen: stateMenu.opened + property bool blockDragHandler: false property Item dragParent @@ -91,7 +92,7 @@ Item { DragHandler { id: dragHandler - enabled: !root.baseState && !root.extendedState && !root.scrollViewActive + enabled: !root.baseState && !root.extendedState && !root.blockDragHandler onGrabChanged: function (transition, point) { if (transition === PointerDevice.GrabPassive || transition === PointerDevice.GrabExclusive) |