diff --git a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp index be6d9b6f93a..6edbacec365 100644 --- a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp +++ b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp @@ -196,7 +196,7 @@ public: SelectionContextOperation action, SelectionContextPredicate enabled = &SelectionContextFunctors::always, SelectionContextPredicate visibility = &SelectionContextFunctors::always) : - ModelNodeContextMenuAction(id, description, category, key, priority, action, enabled, visibility) + ModelNodeContextMenuAction(id, description, {}, category, key, priority, action, enabled, visibility) {} void updateContext() override @@ -223,7 +223,7 @@ public: SelectionContextOperation action, SelectionContextPredicate enabled = &SelectionContextFunctors::always, SelectionContextPredicate visibility = &SelectionContextFunctors::always) : - ModelNodeContextMenuAction(id, description, category, key, priority, action, enabled, visibility) + ModelNodeContextMenuAction(id, description, {}, category, key, priority, action, enabled, visibility) {} void updateContext() override { @@ -657,6 +657,7 @@ void DesignerActionManager::createDefaultDesignerActions() addDesignerAction(new ModelNodeContextMenuAction( toFrontCommandId, toFrontDisplayName, + {}, stackCategory, QKeySequence(), 200, @@ -666,27 +667,26 @@ void DesignerActionManager::createDefaultDesignerActions() addDesignerAction(new ModelNodeContextMenuAction( toBackCommandId, toBackDisplayName, + {}, stackCategory, QKeySequence(), 180, &toBack, &singleSelection)); - addDesignerAction(new ModelNodeFormEditorAction( + addDesignerAction(new ModelNodeContextMenuAction( raiseCommandId, raiseDisplayName, Utils::Icon({{":/qmldesigner/icon/designeractions/images/raise.png", Utils::Theme::IconsBaseColor}}).icon(), - raiseToolTip, stackCategory, QKeySequence(), 160, &raise, &raiseAvailable)); - addDesignerAction(new ModelNodeFormEditorAction( + addDesignerAction(new ModelNodeContextMenuAction( lowerCommandId, lowerDisplayName, Utils::Icon({{":/qmldesigner/icon/designeractions/images/lower.png", Utils::Theme::IconsBaseColor}}).icon(), - lowerToolTip, stackCategory, QKeySequence(), 140, @@ -698,6 +698,7 @@ void DesignerActionManager::createDefaultDesignerActions() addDesignerAction(new ModelNodeContextMenuAction( resetZCommandId, resetZDisplayName, + {}, stackCategory, QKeySequence(), 100, @@ -793,6 +794,7 @@ void DesignerActionManager::createDefaultDesignerActions() addDesignerAction(new ModelNodeContextMenuAction( removePositionerCommandId, removePositionerDisplayName, + {}, positionCategory, QKeySequence("Ctrl+Shift+p"), 210, @@ -803,6 +805,7 @@ void DesignerActionManager::createDefaultDesignerActions() addDesignerAction(new ModelNodeContextMenuAction( layoutRowPositionerCommandId, layoutRowPositionerDisplayName, + {}, positionCategory, QKeySequence(), 200, @@ -813,6 +816,7 @@ void DesignerActionManager::createDefaultDesignerActions() addDesignerAction(new ModelNodeContextMenuAction( layoutColumnPositionerCommandId, layoutColumnPositionerDisplayName, + {}, positionCategory, QKeySequence(), 180, @@ -823,6 +827,7 @@ void DesignerActionManager::createDefaultDesignerActions() addDesignerAction(new ModelNodeContextMenuAction( layoutGridPositionerCommandId, layoutGridPositionerDisplayName, + {}, positionCategory, QKeySequence(), 160, @@ -833,6 +838,7 @@ void DesignerActionManager::createDefaultDesignerActions() addDesignerAction(new ModelNodeContextMenuAction( layoutFlowPositionerCommandId, layoutFlowPositionerDisplayName, + {}, positionCategory, QKeySequence("Ctrl+m"), 140, @@ -845,6 +851,7 @@ void DesignerActionManager::createDefaultDesignerActions() addDesignerAction(new ModelNodeContextMenuAction( removeLayoutCommandId, removeLayoutDisplayName, + {}, layoutCategory, QKeySequence(), 110, @@ -867,6 +874,7 @@ void DesignerActionManager::createDefaultDesignerActions() addDesignerAction(new ModelNodeContextMenuAction( addTabBarToStackedContainerCommandId, addTabBarToStackedContainerDisplayName, + {}, stackedContainerCategory, QKeySequence("Ctrl+Shift+t"), 100, @@ -958,6 +966,7 @@ void DesignerActionManager::createDefaultDesignerActions() addDesignerAction(new ModelNodeContextMenuAction( goIntoComponentCommandId, goIntoComponentDisplayName, + {}, rootCategory, QKeySequence(Qt::Key_F2), priorityGoIntoComponent, @@ -967,6 +976,7 @@ void DesignerActionManager::createDefaultDesignerActions() addDesignerAction(new ModelNodeContextMenuAction( goToImplementationCommandId, goToImplementationDisplayName, + {}, rootCategory, QKeySequence(), 42, @@ -977,6 +987,7 @@ void DesignerActionManager::createDefaultDesignerActions() addDesignerAction(new ModelNodeContextMenuAction( addSignalHandlerCommandId, addSignalHandlerDisplayName, + {}, rootCategory, QKeySequence(), 42, &addNewSignalHandler, &singleSelectedAndUiFile, @@ -985,6 +996,7 @@ void DesignerActionManager::createDefaultDesignerActions() addDesignerAction(new ModelNodeContextMenuAction( moveToComponentCommandId, moveToComponentDisplayName, + {}, rootCategory, QKeySequence(), 44, diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.h b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.h index 435d3913237..67a53ef9972 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.h +++ b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.h @@ -192,7 +192,7 @@ private: class ModelNodeContextMenuAction : public AbstractAction { public: - ModelNodeContextMenuAction(const QByteArray &id, const QString &description, const QByteArray &category, const QKeySequence &key, int priority, + ModelNodeContextMenuAction(const QByteArray &id, const QString &description, const QIcon &icon, const QByteArray &category, const QKeySequence &key, int priority, SelectionContextOperation selectionAction, SelectionContextPredicate enabled = &SelectionContextFunctors::always, SelectionContextPredicate visibility = &SelectionContextFunctors::always) : @@ -204,6 +204,7 @@ public: m_visibility(visibility) { action()->setShortcut(key); + action()->setIcon(icon); } bool isVisible(const SelectionContext &selectionState) const override { return m_visibility(selectionState); } @@ -233,7 +234,7 @@ public: int priority, SelectionContextOperation selectionAction, SelectionContextPredicate enabled = &SelectionContextFunctors::always) : - ModelNodeContextMenuAction(id, description, category, key, priority, selectionAction, enabled, &SelectionContextFunctors::always) + ModelNodeContextMenuAction(id, description, icon, category, key, priority, selectionAction, enabled, &SelectionContextFunctors::always) { action()->setIcon(icon); action()->setToolTip(tooltip); @@ -255,7 +256,7 @@ public: SelectionContextOperation selectionAction, SelectionContextPredicate enabled = &SelectionContextFunctors::always, SelectionContextPredicate visible = &SelectionContextFunctors::always) : - ModelNodeContextMenuAction(id, description, category, key, priority, selectionAction, enabled, visible) + ModelNodeContextMenuAction(id, description, icon, category, key, priority, selectionAction, enabled, visible) { action()->setIcon(icon); action()->setToolTip(tooltip);