feat: honor nativeTheme.themeSource = 'dark'
before creating BrowserWindow on Windows (#25373)
* fix: support 'dark' theme before creating windows.
This commit is contained in:
parent
d3f32c7502
commit
f489e3054a
8 changed files with 241 additions and 0 deletions
28
shell/browser/win/dark_mode.h
Normal file
28
shell/browser/win/dark_mode.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
// Copyright (c) 2020 Microsoft Inc. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE-CHROMIUM file.
|
||||
|
||||
#ifndef SHELL_BROWSER_WIN_DARK_MODE_H_
|
||||
#define SHELL_BROWSER_WIN_DARK_MODE_H_
|
||||
|
||||
#ifdef WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
#else
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
|
||||
#include "ui/native_theme/native_theme.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
namespace win {
|
||||
|
||||
void SetDarkModeForWindow(HWND hWnd, ui::NativeTheme::ThemeSource theme_source);
|
||||
|
||||
} // namespace win
|
||||
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_WIN_DARK_MODE_H_
|
Loading…
Add table
Add a link
Reference in a new issue