fix: make isDarkMode correctly detect dark mode in the auto setting on catalina (#18949)
This commit is contained in:
parent
1cd7c21f38
commit
5686a0713e
1 changed files with 4 additions and 0 deletions
|
@ -628,6 +628,10 @@ void SystemPreferences::RemoveUserDefault(const std::string& name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemPreferences::IsDarkMode() {
|
bool SystemPreferences::IsDarkMode() {
|
||||||
|
if (@available(macOS 10.14, *)) {
|
||||||
|
return [[NSApplication sharedApplication].effectiveAppearance.name
|
||||||
|
isEqualToString:NSAppearanceNameDarkAqua];
|
||||||
|
}
|
||||||
NSString* mode = [[NSUserDefaults standardUserDefaults]
|
NSString* mode = [[NSUserDefaults standardUserDefaults]
|
||||||
stringForKey:@"AppleInterfaceStyle"];
|
stringForKey:@"AppleInterfaceStyle"];
|
||||||
return [mode isEqualToString:@"Dark"];
|
return [mode isEqualToString:@"Dark"];
|
||||||
|
|
Loading…
Reference in a new issue