SYNERGY-691 Systray icon is incorrect for macOS Big Sur (#6944)

* SYNERGY-691 Systray icon is incorrect for macOS Big Sur

* Update ChangeLog
This commit is contained in:
SerhiiGadzhilov 2021-02-10 13:11:40 +03:00 committed by GitHub
parent ec33961905
commit 56710260ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 5 deletions

View file

@ -13,6 +13,7 @@ Bug fixes:
- #6936 Application loses settings
- #6939 Update pipelines to use correct credentials
- #6942 All the text in all the windows should have the same font and size
- #6944 Systray icon is incorrect for macOS Big Sur
Enhancements:
- #6912 Removes UI for Screen Saver Sync and Files Drag and Drop

View file

@ -360,7 +360,7 @@ void MainWindow::setIcon(qSynergyState state) const
QIcon icon;
#ifdef Q_OS_MAC
if (isOSXInterfaceStyleDark())
if (isOSXUseDarkIcons())
icon.addFile(synergyDarkIconFiles[state]);
else
icon.addFile(synergyLightIconFiles[state]);

View file

@ -20,5 +20,6 @@
#define OSXHELPERS__H
bool isOSXInterfaceStyleDark();
bool isOSXUseDarkIcons();
#endif

View file

@ -24,8 +24,19 @@
bool
isOSXInterfaceStyleDark()
{
// Implementation from http://stackoverflow.com/a/26472651
NSDictionary* dict = [[NSUserDefaults standardUserDefaults] persistentDomainForName:NSGlobalDomain];
id style = [dict objectForKey:@"AppleInterfaceStyle"];
return (style && [style isKindOfClass:[NSString class]] && NSOrderedSame == [style caseInsensitiveCompare:@"dark"]);
// Implementation from http://stackoverflow.com/a/26472651
NSDictionary* dict = [[NSUserDefaults standardUserDefaults] persistentDomainForName:NSGlobalDomain];
id style = [dict objectForKey:@"AppleInterfaceStyle"];
return (style && [style isKindOfClass:[NSString class]] && NSOrderedSame == [style caseInsensitiveCompare:@"dark"]);
}
bool
isOSXUseDarkIcons()
{
if (@available(macOS 11, *)) {
return true;
}
else {
return isOSXInterfaceStyleDark();
}
}