diff options
Diffstat (limited to 'share')
-rw-r--r-- | share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml b/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml index ef624574ac..6b01f322f8 100644 --- a/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml +++ b/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml @@ -41,6 +41,8 @@ Rectangle { property int delegateStateImageSize property bool delegateHasWhenCondition property string delegateWhenConditionString + property bool hasAnnotation: checkAnnotation() + readonly property bool isDefaultState: isDefault signal delegateInteraction @@ -53,6 +55,10 @@ Rectangle { return stringList } + function checkAnnotation() { + return statesEditorModel.hasAnnotation(internalNodeId) + } + MouseArea { id: mouseArea anchors.fill: parent @@ -120,11 +126,31 @@ Rectangle { } } + StudioControls.MenuItem { + enabled: !isBaseState + text: (hasAnnotation ? qsTr("Edit Annotation") + : qsTr("Add Annotation")) + onTriggered: { + statesEditorModel.setAnnotation(internalNodeId) + hasAnnotation = checkAnnotation() + } + } + + StudioControls.MenuItem { + enabled: !isBaseState && hasAnnotation + text: qsTr("Remove Annotation") + onTriggered: { + statesEditorModel.removeAnnotation(internalNodeId) + hasAnnotation = checkAnnotation() + } + } + onClosed: { stateNameField.actionIndicator.forceVisible = false } onOpened: { + hasAnnotation = checkAnnotation() myRoot.delegateInteraction() } } |