From 79428126e42c9c7ce972ae04942584ba80861f6f Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Fri, 19 Apr 2013 16:05:50 +0200 Subject: [PATCH] Set NoRole menu role on toggle fullscreen action Again, since the default menu role is TextHeuristicRole, and when we enter fullscreen the text is set to "Exit Full Screen", the Mac QPA menu item syncing will assign this to be the quit menu item. This would cause two problems. First, pressing Cmd-Q in fullscreen would leave fullscreen mode instead of quitting the app. Second, that would make the quit menu item to be hidden when leaving fullscreen, since the toggle fullscreen action text would change back to "Enter Full Screen", and the make a round trip to the menu item heuristic logic. Task-number: QTBUG-30654 Change-Id: I7524c54c3bd77cce891c57292825f02e163fd7fa Reviewed-by: Eike Ziller --- src/plugins/coreplugin/mainwindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 911975ca457..ffcc62edd48 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -753,6 +753,7 @@ void MainWindow::registerDefaultActions() if (supportsFullScreen) { // Full Screen Action m_toggleFullScreenAction = new QAction(fullScreenActionText, this); + m_toggleFullScreenAction->setMenuRole(QAction::NoRole); m_toggleFullScreenAction->setCheckable(!Utils::HostOsInfo::isMacHost()); cmd = ActionManager::registerAction(m_toggleFullScreenAction, Constants::TOGGLE_FULLSCREEN, globalContext); cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Ctrl+Meta+F") : tr("Ctrl+Shift+F11")));