Skip to content

Commit

Permalink
Remove non-document menu icons on macOS / OS X (#3363)
Browse files Browse the repository at this point in the history
Remove icons from non-document menus on macOS

Matches Apple user interface guidelines
  • Loading branch information
follower authored and tresf committed Feb 17, 2017
1 parent 1ff9638 commit b25655f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gui/GuiApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
12 changes: 12 additions & 0 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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" );
Expand All @@ -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
}
}

Expand Down

0 comments on commit b25655f

Please sign in to comment.