Rename dark-mode-changed to platform-theme-changed
This commit is contained in:
parent
b1eefbdcd9
commit
63294892f0
7 changed files with 12 additions and 11 deletions
|
@ -283,8 +283,8 @@ void App::OnGpuProcessCrashed(base::TerminationStatus exit_code) {
|
|||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
void App::OnDarkModeChanged() {
|
||||
Emit("dark-mode-changed");
|
||||
void App::OnPlatformThemeChanged() {
|
||||
Emit("platform-theme-changed");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ class App : public AtomBrowserClient::Delegate,
|
|||
void OnGpuProcessCrashed(base::TerminationStatus exit_code) override;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
void OnDarkModeChanged() override;
|
||||
void OnPlatformThemeChanged() override;
|
||||
#endif
|
||||
|
||||
// mate::Wrappable:
|
||||
|
|
|
@ -181,8 +181,8 @@ void Browser::OnWindowAllClosed() {
|
|||
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnWindowAllClosed());
|
||||
}
|
||||
|
||||
void Browser::DarkModeChanged() {
|
||||
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnDarkModeChanged());
|
||||
void Browser::PlatformThemeChanged() {
|
||||
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnPlatformThemeChanged());
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
|
|
@ -145,7 +145,8 @@ class Browser : public WindowListObserver {
|
|||
// Request basic auth login.
|
||||
void RequestLogin(LoginHandler* login_handler);
|
||||
|
||||
void DarkModeChanged();
|
||||
// Tell the application that plaform's theme changed.
|
||||
void PlatformThemeChanged();
|
||||
|
||||
void AddObserver(BrowserObserver* obs) {
|
||||
observers_.AddObserver(obs);
|
||||
|
|
|
@ -45,7 +45,7 @@ class BrowserObserver {
|
|||
// The browser requests HTTP login.
|
||||
virtual void OnLogin(LoginHandler* login_handler) {}
|
||||
|
||||
virtual void OnDarkModeChanged() {}
|
||||
virtual void OnPlatformThemeChanged() {}
|
||||
|
||||
protected:
|
||||
virtual ~BrowserObserver() {}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"];
|
||||
|
||||
// Add observer to monitor the system's Dark Mode theme.
|
||||
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(darkModeChanged:) name:@"AppleInterfaceThemeChangedNotification" object:nil];
|
||||
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(platformThemeChanged:) name:@"AppleInterfaceThemeChangedNotification" object:nil];
|
||||
|
||||
atom::Browser::Get()->WillFinishLaunching();
|
||||
}
|
||||
|
@ -62,8 +62,8 @@
|
|||
return flag;
|
||||
}
|
||||
|
||||
- (void)darkModeChanged:(NSNotification *)notify {
|
||||
atom::Browser::Get()->DarkModeChanged();
|
||||
- (void)platformThemeChanged:(NSNotification *)notify {
|
||||
atom::Browser::Get()->PlatformThemeChanged();
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -228,7 +228,7 @@ app.on('login', function(event, webContents, request, authInfo, callback) {
|
|||
|
||||
Emitted when the gpu process crashes.
|
||||
|
||||
### Event: 'dark-mode-changed' _OS X_
|
||||
### Event: 'platform-theme-changed' _OS X_
|
||||
|
||||
Emitted when the system's Dark Mode theme is toggled.
|
||||
|
||||
|
|
Loading…
Reference in a new issue