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 (#18959)
  • Loading branch information
trop[bot] authored and codebytere committed Jun 24, 2019
1 parent a568e13 commit 52c76fc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions atom/browser/api/atom_api_system_preferences_mac.mm
Expand Up @@ -439,6 +439,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 52c76fc

Please sign in to comment.