Merge pull request #7036 from symless/SYNERGY-1006-Big-sur-icon-theme
SYNERGY-1006 - Added template mode for icons on Big Sur and higher
This commit is contained in:
commit
54a8a355cb
4 changed files with 28 additions and 13 deletions
|
|
@ -8,6 +8,7 @@ Bug fixes:
|
||||||
- #7001 Add option to prevent computer from going to sleep
|
- #7001 Add option to prevent computer from going to sleep
|
||||||
- #7029 | #7033 Wrong encoding for text copied between linux and windows
|
- #7029 | #7033 Wrong encoding for text copied between linux and windows
|
||||||
- #7015 Fix Windows service not starting up after sleep
|
- #7015 Fix Windows service not starting up after sleep
|
||||||
|
- #7036 Fix tray icon not changing theme on Big Sur
|
||||||
|
|
||||||
Enhancements:
|
Enhancements:
|
||||||
- #6998 Remove functionality related to the screen saver synchronisation
|
- #6998 Remove functionality related to the screen saver synchronisation
|
||||||
|
|
|
||||||
|
|
@ -343,10 +343,19 @@ void MainWindow::setIcon(qSynergyState state) const
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
if (isOSXUseDarkIcons())
|
switch(getOSXIconsTheme()) {
|
||||||
icon.addFile(synergyDarkIconFiles[state]);
|
case IconsTheme::ICONS_DARK:
|
||||||
else
|
icon.addFile(synergyDarkIconFiles[state]);
|
||||||
icon.addFile(synergyLightIconFiles[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
|
#else
|
||||||
icon.addFile(synergyDefaultIconFiles[state]);
|
icon.addFile(synergyDefaultIconFiles[state]);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,13 @@
|
||||||
|
|
||||||
#define OSXHELPERS__H
|
#define OSXHELPERS__H
|
||||||
|
|
||||||
|
enum class IconsTheme {
|
||||||
|
ICONS_DARK,
|
||||||
|
ICONS_LIGHT,
|
||||||
|
ICONS_TEMPLATE
|
||||||
|
};
|
||||||
|
|
||||||
bool isOSXInterfaceStyleDark();
|
bool isOSXInterfaceStyleDark();
|
||||||
bool isOSXUseDarkIcons();
|
IconsTheme getOSXIconsTheme();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -30,13 +30,12 @@ isOSXInterfaceStyleDark()
|
||||||
return (style && [style isKindOfClass:[NSString class]] && NSOrderedSame == [style caseInsensitiveCompare:@"dark"]);
|
return (style && [style isKindOfClass:[NSString class]] && NSOrderedSame == [style caseInsensitiveCompare:@"dark"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
IconsTheme
|
||||||
isOSXUseDarkIcons()
|
getOSXIconsTheme()
|
||||||
{
|
{
|
||||||
if (@available(macOS 11, *)) {
|
if (@available(macOS 11, *))
|
||||||
return true;
|
return IconsTheme::ICONS_TEMPLATE;
|
||||||
}
|
else if(isOSXInterfaceStyleDark())
|
||||||
else {
|
return IconsTheme::ICONS_DARK;
|
||||||
return isOSXInterfaceStyleDark();
|
return IconsTheme::ICONS_LIGHT;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue