From 68b453770bc36539f14e19ca94f7726a238c3e79 Mon Sep 17 00:00:00 2001 From: Daniel Pham Date: Sun, 6 Mar 2016 10:55:47 -0500 Subject: [PATCH] :apple: Rename 'isDarkModeEnabled' to 'isDarkMode' --- atom/browser/api/atom_api_app.cc | 4 ++-- atom/browser/browser.h | 4 ++-- atom/browser/browser_mac.mm | 2 +- docs/api/app.md | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index fc1afb6d35c4..961637852bef 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -376,8 +376,8 @@ mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder( #if defined(OS_MACOSX) .SetMethod("hide", base::Bind(&Browser::Hide, browser)) .SetMethod("show", base::Bind(&Browser::Show, browser)) - .SetMethod("isDarkModeEnabled", - base::Bind(&Browser::IsDarkModeEnabled, browser)) + .SetMethod("isDarkMode", + base::Bind(&Browser::IsDarkMode, browser)) #endif #if defined(OS_WIN) .SetMethod("setUserTasks", diff --git a/atom/browser/browser.h b/atom/browser/browser.h index 8ea523700270..1d0b4aec8ba1 100644 --- a/atom/browser/browser.h +++ b/atom/browser/browser.h @@ -83,8 +83,8 @@ class Browser : public WindowListObserver { // Show the application. void Show(); - // Check if Dark Mode enabled. - bool IsDarkModeEnabled(); + // Check if the system is in Dark Mode. + bool IsDarkMode(); // Bounce the dock icon. enum BounceType { diff --git a/atom/browser/browser_mac.mm b/atom/browser/browser_mac.mm index f5859df97aaa..5988e6620438 100644 --- a/atom/browser/browser_mac.mm +++ b/atom/browser/browser_mac.mm @@ -26,7 +26,7 @@ void Browser::Show() { [[AtomApplication sharedApplication] unhide:nil]; } -bool Browser::IsDarkModeEnabled() { +bool Browser::IsDarkMode() { NSString *mode = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"]; return [mode isEqualToString: @"Dark"]; } diff --git a/docs/api/app.md b/docs/api/app.md index 8cc9c6e37477..f18c978fadd2 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -465,9 +465,9 @@ if (browserOptions.transparent) { } ``` -### `app.isDarkModeEnabled()` _OS X_ +### `app.isDarkMode()` _OS X_ -This method returns `true` if Dark Mode is enabled, and `false` otherwise. +This method returns `true` if the system is in Dark Mode, and `false` otherwise. ### `app.commandLine.appendSwitch(switch[, value])`