1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-01-22 05:38:36 +01:00

Fix systemtray icon on macOS

This commit is contained in:
Jonas Kvinge 2019-08-06 20:31:31 +02:00
parent 6cd4de548f
commit 20766c1feb
2 changed files with 4 additions and 6 deletions

View File

@ -57,8 +57,7 @@ protected:
void UpdateIcon(); void UpdateIcon();
private: private:
QPixmap orange_icon_; QPixmap normal_icon_;
QPixmap grey_icon_;
std::unique_ptr<MacSystemTrayIconPrivate> p_; std::unique_ptr<MacSystemTrayIconPrivate> p_;
Q_DISABLE_COPY(MacSystemTrayIcon); Q_DISABLE_COPY(MacSystemTrayIcon);
}; };

View File

@ -164,9 +164,8 @@ class MacSystemTrayIconPrivate {
MacSystemTrayIcon::MacSystemTrayIcon(QObject* parent) MacSystemTrayIcon::MacSystemTrayIcon(QObject* parent)
: SystemTrayIcon(parent), : SystemTrayIcon(parent),
orange_icon_(QPixmap(":/icons/64x64/strawberry.png").scaled(128, 128, Qt::KeepAspectRatio, Qt::SmoothTransformation)), normal_icon_(QPixmap(":/pictures/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(normal_icon_);
QApplication::setWindowIcon(orange_icon_);
} }
MacSystemTrayIcon::~MacSystemTrayIcon() { MacSystemTrayIcon::~MacSystemTrayIcon() {
@ -194,7 +193,7 @@ void MacSystemTrayIcon::SetupMenuItem(QAction* action) {
} }
void MacSystemTrayIcon::UpdateIcon() { void MacSystemTrayIcon::UpdateIcon() {
QApplication::setWindowIcon(CreateIcon(orange_icon_, grey_icon_)); QApplication::setWindowIcon(CreateIcon(normal_icon_, normal_icon_));
} }
void MacSystemTrayIcon::ActionChanged() { void MacSystemTrayIcon::ActionChanged() {