forked from qt-creator/qt-creator
Move some actions to a "View" menu
A "View" menu seems to be what many users are looking for when they want to show or hide panes/views, so move corresponding actions there. Window management / split actions stay in the "Window" menu. Fixes: QTCREATORBUG-23610 Change-Id: Id683addc681de99abb35697a735fdbc9dc0d00cd Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -424,6 +424,12 @@ void MainWindow::registerDefaultContainers()
|
||||
medit->appendGroup(Constants::G_EDIT_FIND);
|
||||
medit->appendGroup(Constants::G_EDIT_OTHER);
|
||||
|
||||
ActionContainer *mview = ActionManager::createMenu(Constants::M_VIEW);
|
||||
menubar->addMenu(mview, Constants::G_VIEW);
|
||||
mview->menu()->setTitle(tr("&View"));
|
||||
mview->appendGroup(Constants::G_VIEW_VIEWS);
|
||||
mview->appendGroup(Constants::G_VIEW_PANES);
|
||||
|
||||
// Tools Menu
|
||||
ActionContainer *ac = ActionManager::createMenu(Constants::M_TOOLS);
|
||||
menubar->addMenu(ac, Constants::G_TOOLS);
|
||||
@@ -434,8 +440,6 @@ void MainWindow::registerDefaultContainers()
|
||||
menubar->addMenu(mwindow, Constants::G_WINDOW);
|
||||
mwindow->menu()->setTitle(tr("&Window"));
|
||||
mwindow->appendGroup(Constants::G_WINDOW_SIZE);
|
||||
mwindow->appendGroup(Constants::G_WINDOW_VIEWS);
|
||||
mwindow->appendGroup(Constants::G_WINDOW_PANES);
|
||||
mwindow->appendGroup(Constants::G_WINDOW_SPLIT);
|
||||
mwindow->appendGroup(Constants::G_WINDOW_NAVIGATE);
|
||||
mwindow->appendGroup(Constants::G_WINDOW_LIST);
|
||||
@@ -465,6 +469,7 @@ void MainWindow::registerDefaultActions()
|
||||
{
|
||||
ActionContainer *mfile = ActionManager::actionContainer(Constants::M_FILE);
|
||||
ActionContainer *medit = ActionManager::actionContainer(Constants::M_EDIT);
|
||||
ActionContainer *mview = ActionManager::actionContainer(Constants::M_VIEW);
|
||||
ActionContainer *mtools = ActionManager::actionContainer(Constants::M_TOOLS);
|
||||
ActionContainer *mwindow = ActionManager::actionContainer(Constants::M_WINDOW);
|
||||
ActionContainer *mhelp = ActionManager::actionContainer(Constants::M_HELP);
|
||||
@@ -714,7 +719,7 @@ void MainWindow::registerDefaultActions()
|
||||
ProxyAction *toggleLeftSideBarProxyAction =
|
||||
ProxyAction::proxyActionWithIcon(cmd->action(), Utils::Icons::TOGGLE_LEFT_SIDEBAR_TOOLBAR.icon());
|
||||
m_toggleLeftSideBarButton->setDefaultAction(toggleLeftSideBarProxyAction);
|
||||
mwindow->addAction(cmd, Constants::G_WINDOW_VIEWS);
|
||||
mview->addAction(cmd, Constants::G_VIEW_VIEWS);
|
||||
m_toggleLeftSideBarAction->setEnabled(false);
|
||||
|
||||
// Show Right Sidebar Action
|
||||
@@ -730,14 +735,14 @@ void MainWindow::registerDefaultActions()
|
||||
ProxyAction *toggleRightSideBarProxyAction =
|
||||
ProxyAction::proxyActionWithIcon(cmd->action(), Utils::Icons::TOGGLE_RIGHT_SIDEBAR_TOOLBAR.icon());
|
||||
m_toggleRightSideBarButton->setDefaultAction(toggleRightSideBarProxyAction);
|
||||
mwindow->addAction(cmd, Constants::G_WINDOW_VIEWS);
|
||||
mview->addAction(cmd, Constants::G_VIEW_VIEWS);
|
||||
m_toggleRightSideBarButton->setEnabled(false);
|
||||
|
||||
registerModeSelectorStyleActions();
|
||||
|
||||
// Window->Views
|
||||
ActionContainer *mviews = ActionManager::createMenu(Constants::M_WINDOW_VIEWS);
|
||||
mwindow->addMenu(mviews, Constants::G_WINDOW_VIEWS);
|
||||
ActionContainer *mviews = ActionManager::createMenu(Constants::M_VIEW_VIEWS);
|
||||
mview->addMenu(mviews, Constants::G_VIEW_VIEWS);
|
||||
mviews->menu()->setTitle(tr("&Views"));
|
||||
|
||||
// "Help" separators
|
||||
@@ -781,7 +786,7 @@ void MainWindow::registerDefaultActions()
|
||||
|
||||
void MainWindow::registerModeSelectorStyleActions()
|
||||
{
|
||||
ActionContainer *mwindow = ActionManager::actionContainer(Constants::M_WINDOW);
|
||||
ActionContainer *mview = ActionManager::actionContainer(Constants::M_VIEW);
|
||||
|
||||
// Cycle Mode Selector Styles
|
||||
m_cycleModeSelectorStyleAction = new QAction(tr("Cycle Mode Selector Styles"), this);
|
||||
@@ -792,8 +797,8 @@ void MainWindow::registerModeSelectorStyleActions()
|
||||
});
|
||||
|
||||
// Mode Selector Styles
|
||||
ActionContainer *mmodeLayouts = ActionManager::createMenu(Constants::M_WINDOW_MODESTYLES);
|
||||
mwindow->addMenu(mmodeLayouts, Constants::G_WINDOW_VIEWS);
|
||||
ActionContainer *mmodeLayouts = ActionManager::createMenu(Constants::M_VIEW_MODESTYLES);
|
||||
mview->addMenu(mmodeLayouts, Constants::G_VIEW_VIEWS);
|
||||
QMenu *styleMenu = mmodeLayouts->menu();
|
||||
styleMenu->setTitle(tr("Mode Selector Style"));
|
||||
auto *stylesGroup = new QActionGroup(styleMenu);
|
||||
|
||||
Reference in New Issue
Block a user