aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2016-11-15 16:28:14 +0100
committerEike Ziller <eike.ziller@qt.io>2016-11-15 15:42:35 +0000
commit45216d5c1a1d68fb75d267a763031c7c175f869b (patch)
treefe1d4f810f0bcf50eef2e977755db8084cc29f4d
parent37076e8c33aaf7c965446a31d38e371fc34eea87 (diff)
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 <alessandro.portale@qt.io>
-rw-r--r--src/plugins/coreplugin/actionmanager/actionmanager.cpp2
-rw-r--r--src/plugins/coreplugin/actionmanager/command.cpp2
-rw-r--r--src/plugins/coreplugin/editortoolbar.cpp6
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);