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:
parent
ec33961905
commit
56710260ee
4 changed files with 18 additions and 5 deletions
|
|
@ -13,6 +13,7 @@ Bug fixes:
|
||||||
- #6936 Application loses settings
|
- #6936 Application loses settings
|
||||||
- #6939 Update pipelines to use correct credentials
|
- #6939 Update pipelines to use correct credentials
|
||||||
- #6942 All the text in all the windows should have the same font and size
|
- #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:
|
Enhancements:
|
||||||
- #6912 Removes UI for Screen Saver Sync and Files Drag and Drop
|
- #6912 Removes UI for Screen Saver Sync and Files Drag and Drop
|
||||||
|
|
|
||||||
|
|
@ -360,7 +360,7 @@ void MainWindow::setIcon(qSynergyState state) const
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
if (isOSXInterfaceStyleDark())
|
if (isOSXUseDarkIcons())
|
||||||
icon.addFile(synergyDarkIconFiles[state]);
|
icon.addFile(synergyDarkIconFiles[state]);
|
||||||
else
|
else
|
||||||
icon.addFile(synergyLightIconFiles[state]);
|
icon.addFile(synergyLightIconFiles[state]);
|
||||||
|
|
|
||||||
|
|
@ -20,5 +20,6 @@
|
||||||
#define OSXHELPERS__H
|
#define OSXHELPERS__H
|
||||||
|
|
||||||
bool isOSXInterfaceStyleDark();
|
bool isOSXInterfaceStyleDark();
|
||||||
|
bool isOSXUseDarkIcons();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,19 @@
|
||||||
bool
|
bool
|
||||||
isOSXInterfaceStyleDark()
|
isOSXInterfaceStyleDark()
|
||||||
{
|
{
|
||||||
// Implementation from http://stackoverflow.com/a/26472651
|
// Implementation from http://stackoverflow.com/a/26472651
|
||||||
NSDictionary* dict = [[NSUserDefaults standardUserDefaults] persistentDomainForName:NSGlobalDomain];
|
NSDictionary* dict = [[NSUserDefaults standardUserDefaults] persistentDomainForName:NSGlobalDomain];
|
||||||
id style = [dict objectForKey:@"AppleInterfaceStyle"];
|
id style = [dict objectForKey:@"AppleInterfaceStyle"];
|
||||||
return (style && [style isKindOfClass:[NSString class]] && NSOrderedSame == [style caseInsensitiveCompare:@"dark"]);
|
return (style && [style isKindOfClass:[NSString class]] && NSOrderedSame == [style caseInsensitiveCompare:@"dark"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
isOSXUseDarkIcons()
|
||||||
|
{
|
||||||
|
if (@available(macOS 11, *)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return isOSXInterfaceStyleDark();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue