Skip to content

Commit

Permalink
fix: relinquish control of DontShowIconsInMenus
Browse files Browse the repository at this point in the history
No need to force it except on platforms without many QPA plugins like
Mac & Windows.
  • Loading branch information
nullobsi committed Jul 27, 2024
1 parent c7039d6 commit 0d463d7
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gui/application_mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Application::Application(int& argc, char** argv)
: SingleApplication(argc, argv)
{
setAttribute(Qt::AA_DontShowIconsInMenus, true);
setAttribute(Qt::AA_DontShowIconsInMenus, false);

// Set DYLD_LIBRARY_PATH so that Qt finds our openSSL libs
QDir dir(argv[0]);
Expand Down
3 changes: 0 additions & 3 deletions gui/application_qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ bool Application::start(const QStringList& files)
{
// TODO: Add an option to try to run anyway when DBUS binding fails.
if (QDBusConnection::sessionBus().registerService(PROJECT_REV_ID)) {
if (Utils::KDE != Utils::currentDe()) {
setAttribute(Qt::AA_DontShowIconsInMenus, true);
}
return true;
}
loadFiles(files);
Expand Down
2 changes: 1 addition & 1 deletion gui/application_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Application::Application(int& argc, char** argv)
: SingleApplication(argc, argv)
{
installNativeEventFilter(this);
setAttribute(Qt::AA_DontShowIconsInMenus, true);
setAttribute(Qt::AA_DontShowIconsInMenus, false);
}

bool Application::nativeEventFilter(const QByteArray&, void* message, qintptr* result)
Expand Down
1 change: 0 additions & 1 deletion gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ MainWindow::MainWindow(QWidget* parent)
setWindowTitle("Cantata");
QWidget* tb = toolbar;
#ifdef Q_OS_MAC
qApp->setAttribute(Qt::AA_DontShowIconsInMenus, false);
setUnifiedTitleAndToolBarOnMac(true);
QToolBar* topToolBar = addToolBar("ToolBar");
WindowManager* wm = new WindowManager(topToolBar);
Expand Down
3 changes: 1 addition & 2 deletions support/shortcutsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ ShortcutsModel::ShortcutsModel(const QHash<QString, ActionCollection*>& actionCo
: QAbstractItemModel(parent),
_changedCount(0)
{
_showIcons = !QCoreApplication::testAttribute(Qt::AA_DontShowIconsInMenus);
for (int r = 0; r < actionCollections.values().count(); r++) {
ActionCollection* coll = actionCollections.values().at(r);
Item* item = new Item();
Expand Down Expand Up @@ -158,7 +157,7 @@ QVariant ShortcutsModel::data(const QModelIndex& index, int role) const
}

case Qt::DecorationRole:
if (index.column() == 0 && _showIcons)
if (index.column() == 0 && !QCoreApplication::testAttribute(Qt::AA_DontShowIconsInMenus))
return action->icon();
return QVariant();

Expand Down
1 change: 0 additions & 1 deletion support/shortcutsmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ public slots:

QList<Item*> _categoryItems;
int _changedCount;
bool _showIcons;
};

#endif// SHORTCUTSMODEL_H

0 comments on commit 0d463d7

Please sign in to comment.