Skip to content

Commit

Permalink
fix: make isDarkMode correctly detect dark mode in the auto setting o…
Browse files Browse the repository at this point in the history
…n catalina (#18949)
  • Loading branch information
MarshallOfSound committed Jun 24, 2019
1 parent 1cd7c21 commit 5686a07
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions shell/browser/api/atom_api_system_preferences_mac.mm
Expand Up @@ -628,6 +628,10 @@ AVMediaType ParseMediaType(const std::string& media_type) {
}

bool SystemPreferences::IsDarkMode() {
if (@available(macOS 10.14, *)) {
return [[NSApplication sharedApplication].effectiveAppearance.name
isEqualToString:NSAppearanceNameDarkAqua];
}
NSString* mode = [[NSUserDefaults standardUserDefaults]
stringForKey:@"AppleInterfaceStyle"];
return [mode isEqualToString:@"Dark"];
Expand Down

0 comments on commit 5686a07

Please sign in to comment.