From b25655f9fec76002318255bdb079610d7432b549 Mon Sep 17 00:00:00 2001 From: follower Date: Fri, 17 Feb 2017 19:48:27 +1300 Subject: [PATCH] Remove non-document menu icons on macOS / OS X (#3363) Remove icons from non-document menus on macOS Matches Apple user interface guidelines --- src/gui/GuiApplication.cpp | 4 ++++ src/gui/MainWindow.cpp | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/gui/GuiApplication.cpp b/src/gui/GuiApplication.cpp index e849a2f56..2c277d6de 100644 --- a/src/gui/GuiApplication.cpp +++ b/src/gui/GuiApplication.cpp @@ -75,6 +75,10 @@ GuiApplication::GuiApplication() QApplication::setPalette( *lpal ); LmmsStyle::s_palette = lpal; +#ifdef LMMS_BUILD_APPLE + QApplication::setAttribute(Qt::AA_DontShowIconsInMenus, true); +#endif + // Show splash screen QSplashScreen splashScreen( embed::getIconPixmap( "splash" ) ); splashScreen.show(); diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 27992399e..b7cba1faa 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -893,6 +893,10 @@ void MainWindow::updateRecentlyOpenedProjectsMenu() { m_recentlyOpenedProjectsMenu->addAction( embed::getIconPixmap( "project_file" ), *it ); +#ifdef LMMS_BUILD_APPLE + m_recentlyOpenedProjectsMenu->actions().last()->setIconVisibleInMenu(false); // QTBUG-44565 workaround + m_recentlyOpenedProjectsMenu->actions().last()->setIconVisibleInMenu(true); +#endif shownInMenu++; if( shownInMenu >= 15 ) { @@ -1482,6 +1486,10 @@ void MainWindow::fillTemplatesMenu() m_templatesMenu->addAction( embed::getIconPixmap( "project_file" ), ( *it ).left( ( *it ).length() - 4 ) ); +#ifdef LMMS_BUILD_APPLE + m_templatesMenu->actions().last()->setIconVisibleInMenu(false); // QTBUG-44565 workaround + m_templatesMenu->actions().last()->setIconVisibleInMenu(true); +#endif } QDir d( ConfigManager::inst()->factoryProjectsDir() + "templates" ); @@ -1499,6 +1507,10 @@ void MainWindow::fillTemplatesMenu() m_templatesMenu->addAction( embed::getIconPixmap( "project_file" ), ( *it ).left( ( *it ).length() - 4 ) ); +#ifdef LMMS_BUILD_APPLE + m_templatesMenu->actions().last()->setIconVisibleInMenu(false); // QTBUG-44565 workaround + m_templatesMenu->actions().last()->setIconVisibleInMenu(true); +#endif } }