From 45216d5c1a1d68fb75d267a763031c7c175f869b Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 15 Nov 2016 16:28:14 +0100 Subject: [PATCH] macOS: Fix that some actions still had icon in menu For example when toolbars showed a menu for actions that no longer fit (e.g. open diff viewer, reduce window size until the synchronize and switch view buttons vanish). Use the application flag to disable icons in menus on macOS globally instead of doing that individually on the actions. Change-Id: I3b682f48ee0e866f0f0d5bb0834690937f427d7f Reviewed-by: Alessandro Portale --- src/plugins/coreplugin/actionmanager/actionmanager.cpp | 2 ++ src/plugins/coreplugin/actionmanager/command.cpp | 2 -- src/plugins/coreplugin/editortoolbar.cpp | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp index e3771101b75..526542a6175 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp +++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp @@ -163,6 +163,8 @@ ActionManager::ActionManager(QObject *parent) { m_instance = this; d = new ActionManagerPrivate; + if (Utils::HostOsInfo::isMacHost()) + QCoreApplication::setAttribute(Qt::AA_DontShowIconsInMenus); } /*! diff --git a/src/plugins/coreplugin/actionmanager/command.cpp b/src/plugins/coreplugin/actionmanager/command.cpp index 3e737290ae3..cdbbe200e3a 100644 --- a/src/plugins/coreplugin/actionmanager/command.cpp +++ b/src/plugins/coreplugin/actionmanager/command.cpp @@ -306,8 +306,6 @@ static QString msgActionWarning(QAction *newAction, Id id, QAction *oldAction) void Action::addOverrideAction(QAction *action, const Context &context, bool scriptable) { - if (Utils::HostOsInfo::isMacHost()) - action->setIconVisibleInMenu(false); // disallow TextHeuristic menu role, because it doesn't work with translations, // e.g. QTCREATORBUG-13101 if (action->menuRole() == QAction::TextHeuristicRole) diff --git a/src/plugins/coreplugin/editortoolbar.cpp b/src/plugins/coreplugin/editortoolbar.cpp index 466598129f8..de912d6f2c4 100644 --- a/src/plugins/coreplugin/editortoolbar.cpp +++ b/src/plugins/coreplugin/editortoolbar.cpp @@ -159,12 +159,6 @@ EditorToolBar::EditorToolBar(QWidget *parent) : d->m_forwardButton->setDefaultAction(d->m_goForwardAction); - if (Utils::HostOsInfo::isMacHost()) { - d->m_horizontalSplitAction->setIconVisibleInMenu(false); - d->m_verticalSplitAction->setIconVisibleInMenu(false); - d->m_splitNewWindowAction->setIconVisibleInMenu(false); - } - d->m_splitButton->setIcon(Utils::Icons::SPLIT_HORIZONTAL_TOOLBAR.icon()); d->m_splitButton->setToolTip(tr("Split")); d->m_splitButton->setPopupMode(QToolButton::InstantPopup);