diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2017-01-19 09:44:13 +0100 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2017-01-19 10:26:21 +0000 |
commit | d5ac800b90ca8f12682c68530938c7490d0fe052 (patch) | |
tree | 8d0eae745a52298c6e82964494c69e1297d0873e /src/plugins/qmldesigner/shortcutmanager.cpp | |
parent | 58e7554f3d2f00bb3a65205274bfd0f73c491818 (diff) |
QmlDesigner: Hook up states editor expanded state to command
The expanded/collpased state of the states editor is now hooked up to
a Qt Creator command. This means there is a configurable shortcurt
and an entry in the menu under Windows/Views.
Change-Id: Ied993870fe605cfd6651b203986b009620c98f1b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner/shortcutmanager.cpp')
-rw-r--r-- | src/plugins/qmldesigner/shortcutmanager.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/shortcutmanager.cpp b/src/plugins/qmldesigner/shortcutmanager.cpp index e76d9d6153..bb907d9a6c 100644 --- a/src/plugins/qmldesigner/shortcutmanager.cpp +++ b/src/plugins/qmldesigner/shortcutmanager.cpp @@ -81,6 +81,7 @@ ShortCutManager::ShortCutManager() m_pasteAction(tr("&Paste"), tr("Paste \"%1\""), Utils::ParameterAction::EnabledWithParameter), m_selectAllAction(tr("Select &All"), tr("Select All \"%1\""), Utils::ParameterAction::EnabledWithParameter), m_hideSidebarsAction(tr("Toggle Sidebars"), 0), + m_collapseExpandStatesAction(tr("Toggle States Editor"), 0), m_restoreDefaultViewAction(tr("&Restore Default View"), 0), m_toggleLeftSidebarAction(tr("Toggle &Left Sidebar"), 0), m_toggleRightSidebarAction(tr("Toggle &Right Sidebar"), 0), @@ -130,6 +131,10 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex QmlDesignerPlugin::instance()->mainWidget(), SLOT(toggleRightSidebar())); + connect(&m_collapseExpandStatesAction, &QAction::triggered, [] { + QmlDesignerPlugin::instance()->viewManager().toggleStatesViewExpanded(); + }); + // Revert to saved Core::EditorManager *em = Core::EditorManager::instance(); Core::ActionManager::registerAction(&m_revertToSavedAction,Core::Constants::REVERTTOSAVED, qmlDesignerMainContext); @@ -250,6 +255,11 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex command->setDefaultKeySequence(QKeySequence("Ctrl+Alt+Shift+0")); viewsMenu->addAction(command); + command = Core::ActionManager::registerAction(&m_collapseExpandStatesAction, Constants::TOGGLE_STATES_EDITOR, qmlDesignerMainContext); + command->setAttribute(Core::Command::CA_Hide); + command->setDefaultKeySequence(QKeySequence("Ctrl+Alt+s")); + viewsMenu->addAction(command); + command = Core::ActionManager::registerAction(&m_restoreDefaultViewAction, Constants::RESTORE_DEFAULT_VIEW, qmlDesignerMainContext); command->setAttribute(Core::Command::CA_Hide); viewsMenu->addAction(command); |