From 20766c1feb96acb3007be7c7e735f8183bbb8b38 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Tue, 6 Aug 2019 20:31:31 +0200 Subject: [PATCH] Fix systemtray icon on macOS --- src/core/macsystemtrayicon.h | 3 +-- src/core/macsystemtrayicon.mm | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/core/macsystemtrayicon.h b/src/core/macsystemtrayicon.h index 0992746a4..8eb1988aa 100644 --- a/src/core/macsystemtrayicon.h +++ b/src/core/macsystemtrayicon.h @@ -57,8 +57,7 @@ protected: void UpdateIcon(); private: - QPixmap orange_icon_; - QPixmap grey_icon_; + QPixmap normal_icon_; std::unique_ptr p_; Q_DISABLE_COPY(MacSystemTrayIcon); }; diff --git a/src/core/macsystemtrayicon.mm b/src/core/macsystemtrayicon.mm index 7dceaa81f..380cd55c9 100644 --- a/src/core/macsystemtrayicon.mm +++ b/src/core/macsystemtrayicon.mm @@ -164,9 +164,8 @@ class MacSystemTrayIconPrivate { MacSystemTrayIcon::MacSystemTrayIcon(QObject* parent) : SystemTrayIcon(parent), - orange_icon_(QPixmap(":/icons/64x64/strawberry.png").scaled(128, 128, Qt::KeepAspectRatio, Qt::SmoothTransformation)), - grey_icon_(QPixmap(":icon_large_grey.png").scaled(128, 128, Qt::KeepAspectRatio, Qt::SmoothTransformation)) { - QApplication::setWindowIcon(orange_icon_); + normal_icon_(QPixmap(":/pictures/strawberry.png").scaled(128, 128, Qt::KeepAspectRatio, Qt::SmoothTransformation)) { + QApplication::setWindowIcon(normal_icon_); } MacSystemTrayIcon::~MacSystemTrayIcon() { @@ -194,7 +193,7 @@ void MacSystemTrayIcon::SetupMenuItem(QAction* action) { } void MacSystemTrayIcon::UpdateIcon() { - QApplication::setWindowIcon(CreateIcon(orange_icon_, grey_icon_)); + QApplication::setWindowIcon(CreateIcon(normal_icon_, normal_icon_)); } void MacSystemTrayIcon::ActionChanged() {