chore: rename atom -> electron (#21986)
This commit is contained in:
parent
f14fc4b041
commit
d9321f4df7
287 changed files with 1771 additions and 1708 deletions
37
shell/browser/api/electron_api_native_theme_mac.mm
Normal file
37
shell/browser/api/electron_api_native_theme_mac.mm
Normal file
|
@ -0,0 +1,37 @@
|
|||
// Copyright (c) 2019 Slack Technologies, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "shell/browser/api/electron_api_native_theme.h"
|
||||
|
||||
#include "base/mac/sdk_forward_declarations.h"
|
||||
#include "shell/browser/mac/electron_application.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
namespace api {
|
||||
|
||||
void NativeTheme::UpdateMacOSAppearanceForOverrideValue(
|
||||
ui::NativeTheme::ThemeSource override) {
|
||||
if (@available(macOS 10.14, *)) {
|
||||
NSAppearance* new_appearance;
|
||||
switch (override) {
|
||||
case ui::NativeTheme::ThemeSource::kForcedDark:
|
||||
new_appearance =
|
||||
[NSAppearance appearanceNamed:NSAppearanceNameDarkAqua];
|
||||
break;
|
||||
case ui::NativeTheme::ThemeSource::kForcedLight:
|
||||
new_appearance = [NSAppearance appearanceNamed:NSAppearanceNameAqua];
|
||||
break;
|
||||
case ui::NativeTheme::ThemeSource::kSystem:
|
||||
default:
|
||||
new_appearance = nil;
|
||||
break;
|
||||
}
|
||||
[[NSApplication sharedApplication] setAppearance:new_appearance];
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace api
|
||||
|
||||
} // namespace electron
|
Loading…
Add table
Add a link
Reference in a new issue