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:
@@ -29,6 +29,7 @@
|
||||
#include <stack>
|
||||
|
||||
#import <AppKit/NSTouchBar.h>
|
||||
#import <AppKit/NSWindow.h>
|
||||
|
||||
Q_GLOBAL_STATIC(Utils::Internal::ApplicationDelegate, staticApplicationDelegate);
|
||||
|
||||
@@ -148,4 +149,11 @@ using namespace Utils::Internal;
|
||||
[anInvocation invokeWithTarget:self.qtDelegate];
|
||||
}
|
||||
|
||||
// Work around QTBUG-61707
|
||||
- (void)applicationWillFinishLaunching:(NSNotification*)notify
|
||||
{
|
||||
Q_UNUSED(notify)
|
||||
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"];
|
||||
NSWindow.allowsAutomaticWindowTabbing = NO;
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
- (void)setApplicationTouchBar:(Utils::Internal::TouchBarPrivate *)bar;
|
||||
- (void)pushTouchBar:(Utils::Internal::TouchBarPrivate *)bar;
|
||||
- (void)popTouchBar;
|
||||
- (void)applicationWillFinishLaunching:(NSNotification*)notify;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -49,12 +49,13 @@ const char M_FILE[] = "QtCreator.Menu.File";
|
||||
const char M_FILE_RECENTFILES[] = "QtCreator.Menu.File.RecentFiles";
|
||||
const char M_EDIT[] = "QtCreator.Menu.Edit";
|
||||
const char M_EDIT_ADVANCED[] = "QtCreator.Menu.Edit.Advanced";
|
||||
const char M_VIEW[] = "QtCreator.Menu.View";
|
||||
const char M_VIEW_MODESTYLES[] = "QtCreator.Menu.View.ModeStyles";
|
||||
const char M_VIEW_VIEWS[] = "QtCreator.Menu.View.Views";
|
||||
const char M_VIEW_PANES[] = "QtCreator.Menu.View.Panes";
|
||||
const char M_TOOLS[] = "QtCreator.Menu.Tools";
|
||||
const char M_TOOLS_EXTERNAL[] = "QtCreator.Menu.Tools.External";
|
||||
const char M_WINDOW[] = "QtCreator.Menu.Window";
|
||||
const char M_WINDOW_PANES[] = "QtCreator.Menu.Window.Panes";
|
||||
const char M_WINDOW_MODESTYLES[] = "QtCreator.Menu.Window.ModeStyles";
|
||||
const char M_WINDOW_VIEWS[] = "QtCreator.Menu.Window.Views";
|
||||
const char M_HELP[] = "QtCreator.Menu.Help";
|
||||
|
||||
// Contexts
|
||||
@@ -174,12 +175,15 @@ const char G_EDIT_BLOCKS[] = "QtCreator.Group.Edit.Blocks";
|
||||
const char G_EDIT_FONT[] = "QtCreator.Group.Edit.Font";
|
||||
const char G_EDIT_EDITOR[] = "QtCreator.Group.Edit.Editor";
|
||||
|
||||
// View menu groups
|
||||
const char G_VIEW_VIEWS[] = "QtCreator.Group.View.Views";
|
||||
const char G_VIEW_PANES[] = "QtCreator.Group.View.Panes";
|
||||
|
||||
// Tools menu groups
|
||||
const char G_TOOLS_OPTIONS[] = "QtCreator.Group.Tools.Options";
|
||||
|
||||
// Window menu groups
|
||||
const char G_WINDOW_SIZE[] = "QtCreator.Group.Window.Size";
|
||||
const char G_WINDOW_PANES[] = "QtCreator.Group.Window.Panes";
|
||||
const char G_WINDOW_VIEWS[] = "QtCreator.Group.Window.Views";
|
||||
const char G_WINDOW_SPLIT[] = "QtCreator.Group.Window.Split";
|
||||
const char G_WINDOW_NAVIGATE[] = "QtCreator.Group.Window.Navigate";
|
||||
const char G_WINDOW_LIST[] = "QtCreator.Group.Window.List";
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -391,11 +391,11 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) :
|
||||
|
||||
StatusBarManager::addStatusBarWidget(m_buttonsWidget, StatusBarManager::Second);
|
||||
|
||||
ActionContainer *mwindow = ActionManager::actionContainer(Constants::M_WINDOW);
|
||||
ActionContainer *mview = ActionManager::actionContainer(Constants::M_VIEW);
|
||||
|
||||
// Window->Output Panes
|
||||
ActionContainer *mpanes = ActionManager::createMenu(Constants::M_WINDOW_PANES);
|
||||
mwindow->addMenu(mpanes, Constants::G_WINDOW_PANES);
|
||||
ActionContainer *mpanes = ActionManager::createMenu(Constants::M_VIEW_PANES);
|
||||
mview->addMenu(mpanes, Constants::G_VIEW_PANES);
|
||||
mpanes->menu()->setTitle(tr("Output &Panes"));
|
||||
mpanes->appendGroup("Coreplugin.OutputPane.ActionsGroup");
|
||||
mpanes->appendGroup("Coreplugin.OutputPane.PanesGroup");
|
||||
|
||||
@@ -253,7 +253,7 @@ DebuggerMainWindowPrivate::DebuggerMainWindowPrivate(DebuggerMainWindow *parent)
|
||||
q->addDockWidget(Qt::BottomDockWidgetArea, m_toolBarDock);
|
||||
|
||||
connect(viewButton, &QAbstractButton::clicked, this, [this, viewButton] {
|
||||
ActionContainer *viewsMenu = ActionManager::actionContainer(Core::Constants::M_WINDOW_VIEWS);
|
||||
ActionContainer *viewsMenu = ActionManager::actionContainer(Core::Constants::M_VIEW_VIEWS);
|
||||
viewsMenu->menu()->exec(viewButton->mapToGlobal(QPoint()));
|
||||
});
|
||||
|
||||
@@ -279,7 +279,7 @@ DebuggerMainWindow::DebuggerMainWindow()
|
||||
|
||||
Context debugcontext(Debugger::Constants::C_DEBUGMODE);
|
||||
|
||||
ActionContainer *viewsMenu = ActionManager::actionContainer(Core::Constants::M_WINDOW_VIEWS);
|
||||
ActionContainer *viewsMenu = ActionManager::actionContainer(Core::Constants::M_VIEW_VIEWS);
|
||||
Command *cmd = ActionManager::registerAction(showCentralWidgetAction(),
|
||||
"Debugger.Views.ShowCentralWidget", debugcontext);
|
||||
cmd->setAttribute(Command::CA_Hide);
|
||||
@@ -312,7 +312,7 @@ DebuggerMainWindow::~DebuggerMainWindow()
|
||||
|
||||
void DebuggerMainWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
{
|
||||
ActionContainer *viewsMenu = ActionManager::actionContainer(Core::Constants::M_WINDOW_VIEWS);
|
||||
ActionContainer *viewsMenu = ActionManager::actionContainer(Core::Constants::M_VIEW_VIEWS);
|
||||
viewsMenu->menu()->exec(ev->globalPos());
|
||||
}
|
||||
|
||||
@@ -893,7 +893,7 @@ void Perspective::addWindow(QWidget *widget,
|
||||
|
||||
Command *cmd = ActionManager::registerAction(op.toggleViewAction, op.commandId, d->context());
|
||||
cmd->setAttribute(Command::CA_Hide);
|
||||
ActionManager::actionContainer(Core::Constants::M_WINDOW_VIEWS)->addAction(cmd);
|
||||
ActionManager::actionContainer(Core::Constants::M_VIEW_VIEWS)->addAction(cmd);
|
||||
}
|
||||
|
||||
d->m_dockOperations.append(op);
|
||||
|
||||
@@ -313,7 +313,7 @@ void FormEditorData::addDockViewAction(ActionContainer *viewMenu,
|
||||
void FormEditorData::setupViewActions()
|
||||
{
|
||||
// Populate "View" menu of form editor menu
|
||||
ActionContainer *viewMenu = ActionManager::actionContainer(Core::Constants::M_WINDOW_VIEWS);
|
||||
ActionContainer *viewMenu = ActionManager::actionContainer(Core::Constants::M_VIEW_VIEWS);
|
||||
QTC_ASSERT(viewMenu, return);
|
||||
|
||||
addDockViewAction(viewMenu, WidgetBoxSubWindow, m_contexts,
|
||||
|
||||
@@ -244,11 +244,11 @@ void DesignModeWidget::setup()
|
||||
// Setup Actions and Menus
|
||||
Core::ActionContainer *mwindow = Core::ActionManager::actionContainer(Core::Constants::M_WINDOW);
|
||||
// Window > Views
|
||||
Core::ActionContainer *mviews = Core::ActionManager::createMenu(Core::Constants::M_WINDOW_VIEWS);
|
||||
Core::ActionContainer *mviews = Core::ActionManager::createMenu(Core::Constants::M_VIEW_VIEWS);
|
||||
mviews->menu()->addSeparator();
|
||||
// Window > Workspaces
|
||||
Core::ActionContainer *mworkspaces = Core::ActionManager::createMenu(QmlDesigner::Constants::M_WINDOW_WORKSPACES);
|
||||
mwindow->addMenu(mworkspaces, Core::Constants::G_WINDOW_VIEWS);
|
||||
mwindow->addMenu(mworkspaces, Core::Constants::G_VIEW_VIEWS);
|
||||
mworkspaces->menu()->setTitle(tr("&Workspaces"));
|
||||
mworkspaces->setOnAllDisabledBehavior(Core::ActionContainer::Show); // TODO what does it exactly do?!
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex
|
||||
command->setDefaultKeySequence(QKeySequence::SelectAll);
|
||||
editMenu->addAction(command, Core::Constants::G_EDIT_SELECTALL);
|
||||
|
||||
Core::ActionContainer *viewsMenu = Core::ActionManager::actionContainer(Core::Constants::M_WINDOW_VIEWS);
|
||||
Core::ActionContainer *viewsMenu = Core::ActionManager::actionContainer(Core::Constants::M_VIEW_VIEWS);
|
||||
|
||||
command = Core::ActionManager::registerAction(&m_collapseExpandStatesAction, Constants::TOGGLE_STATES_EDITOR, qmlDesignerMainContext);
|
||||
command->setAttribute(Core::Command::CA_Hide);
|
||||
|
||||
Reference in New Issue
Block a user