diff options
author | Marco Bubke <marco.bubke@digia.com> | 2014-07-03 13:08:12 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@digia.com> | 2014-07-04 15:41:45 +0200 |
commit | aea7f77af9673042d64f3222424c0277e0b8a3eb (patch) | |
tree | e668ecc2ab1ba487ae7f4f805daf0883e997f41b | |
parent | df6c07694fe81463c05e8a72a797343ed7f107bf (diff) |
QmlDesigner: Show context menu in the states editor in whole view
Change-Id: I656c803f066bcdf1b3b39879194cc4698832083b
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
-rw-r--r-- | share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml | 23 | ||||
-rw-r--r-- | share/qtcreator/qmldesigner/statesEditorQmlSources/StatesList.qml | 22 |
2 files changed, 24 insertions, 21 deletions
diff --git a/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml b/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml index f6dc75f62f..6da0137ed6 100644 --- a/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml +++ b/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml @@ -50,27 +50,10 @@ Rectangle { MouseArea { anchors.fill: parent - acceptedButtons: Qt.LeftButton | Qt.RightButton - + acceptedButtons: Qt.LeftButton onClicked: { - if (mouse.button === Qt.LeftButton) { - focus = true - root.currentStateInternalId = internalNodeId - } else if (mouse.button === Qt.RightButton) { - contextMenu.popup() - } - } - - Menu { - id: contextMenu - - MenuItem { - text: root.expanded ? qsTr("Collapse") : qsTr("Expand") - onTriggered: { - root.expanded = ! root.expanded - } - - } + focus = true + root.currentStateInternalId = internalNodeId } } diff --git a/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesList.qml b/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesList.qml index ad4d8c453b..3b4033da7d 100644 --- a/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesList.qml +++ b/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesList.qml @@ -63,9 +63,29 @@ FocusScope { anchors.fill: parent color: "#4f4f4f" } + MouseArea { anchors.fill: parent - onClicked: focus = true + acceptedButtons: Qt.LeftButton | Qt.RightButton + + onClicked: { + if (mouse.button === Qt.LeftButton) + focus = true + else if (mouse.button === Qt.RightButton) + contextMenu.popup() + } + + Menu { + id: contextMenu + + MenuItem { + text: root.expanded ? qsTr("Collapse") : qsTr("Expand") + onTriggered: { + root.expanded = !root.expanded + } + + } + } } Item { |