diff --git a/ChangeLog b/ChangeLog index fc57a3f15..355024bbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ Bug fixes: - #7001 Add option to prevent computer from going to sleep - #7029 | #7033 Wrong encoding for text copied between linux and windows - #7015 Fix Windows service not starting up after sleep +- #7036 Fix tray icon not changing theme on Big Sur Enhancements: - #6998 Remove functionality related to the screen saver synchronisation diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index 30067ba8f..58e08cc9c 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -343,10 +343,19 @@ void MainWindow::setIcon(qSynergyState state) const QIcon icon; #ifdef Q_OS_MAC - if (isOSXUseDarkIcons()) - icon.addFile(synergyDarkIconFiles[state]); - else - icon.addFile(synergyLightIconFiles[state]); + switch(getOSXIconsTheme()) { + case IconsTheme::ICONS_DARK: + icon.addFile(synergyDarkIconFiles[state]); + break; + case IconsTheme::ICONS_LIGHT: + icon.addFile(synergyLightIconFiles[state]); + break; + case IconsTheme::ICONS_TEMPLATE: + default: + icon.addFile(synergyDarkIconFiles[state]); + icon.setIsMask(true); + break; + } #else icon.addFile(synergyDefaultIconFiles[state]); #endif diff --git a/src/gui/src/OSXHelpers.h b/src/gui/src/OSXHelpers.h index 05643ad50..6f79c5162 100644 --- a/src/gui/src/OSXHelpers.h +++ b/src/gui/src/OSXHelpers.h @@ -19,7 +19,13 @@ #define OSXHELPERS__H +enum class IconsTheme { + ICONS_DARK, + ICONS_LIGHT, + ICONS_TEMPLATE +}; + bool isOSXInterfaceStyleDark(); -bool isOSXUseDarkIcons(); +IconsTheme getOSXIconsTheme(); #endif diff --git a/src/gui/src/OSXHelpers.mm b/src/gui/src/OSXHelpers.mm index ce5aa4592..a58d620a0 100644 --- a/src/gui/src/OSXHelpers.mm +++ b/src/gui/src/OSXHelpers.mm @@ -30,13 +30,12 @@ isOSXInterfaceStyleDark() return (style && [style isKindOfClass:[NSString class]] && NSOrderedSame == [style caseInsensitiveCompare:@"dark"]); } -bool -isOSXUseDarkIcons() +IconsTheme +getOSXIconsTheme() { - if (@available(macOS 11, *)) { - return true; - } - else { - return isOSXInterfaceStyleDark(); - } + if (@available(macOS 11, *)) + return IconsTheme::ICONS_TEMPLATE; + else if(isOSXInterfaceStyleDark()) + return IconsTheme::ICONS_DARK; + return IconsTheme::ICONS_LIGHT; }