Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove non-document menu icons on macOS / OS X #3363

Merged
merged 3 commits into from
Feb 17, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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); // Workaround for https://bugreports.qt.io/browse/QTBUG-44565
Copy link
Member

@tresf tresf Feb 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel this would be cleaner

m_recentlyOpenedProjectsMenu->actions().last()->setIconVisibleInMenu(false); // Per QTBUG-44565
m_recentlyOpenedProjectsMenu->actions().last()->setIconVisibleInMenu(true);

Alternately, you could put the comment on it's own line, which has the downside of taking it slightly out of context.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did wonder about URL vs bug number but went with the full URL since that's what we used in #3350.

I'd tend toward still indicating it's a workaround, so would prefer to go with:

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); // Workaround for https://bugreports.qt.io/browse/QTBUG-44565
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); // Workaround for https://bugreports.qt.io/browse/QTBUG-44565
m_templatesMenu->actions().last()->setIconVisibleInMenu(true);
#endif
}
}

Expand Down