-
Notifications
You must be signed in to change notification settings - Fork 868
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use brave theme type as a system dark mode on Windows
Aligning base UI theme(ex, context menu) with brave theme was not implemented on Windows because Windows doesn't support per-application theme. Whereas, MacOS support it. So, when user set dark or light, it is set as a application theme. To solve this on Windows, NativeThemeWin::SystemDarkModeEnabled() checks whether dark mode enabling is overridden or not. Overridden value is set by client(BraveThemeService).
- Loading branch information
Showing
6 changed files
with
87 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* Copyright (c) 2019 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "../../../../ui/native_theme/native_theme_win.h" | ||
|
||
// Custom header guard is used to avoid including function declaration multiple | ||
// times. | ||
#ifndef UI_NATIVE_THEME_NATIVE_THEME_WIN_H_BRAVE_ // NOLINT | ||
#define UI_NATIVE_THEME_NATIVE_THEME_WIN_H_BRAVE_ // NOLINT | ||
|
||
namespace ui { | ||
|
||
// If |override| is true, system dark mode is overridden by |enable_dark_mode|. | ||
// If |override| is false, |enable_dark_mode| is ignored. | ||
void NATIVE_THEME_EXPORT SetOverrideSystemDarkMode(bool override, | ||
bool enable_dark_mode); | ||
} // namespace ui | ||
|
||
#endif // UI_NATIVE_THEME_NATIVE_THEME_WIN_H_BRAVE_ // NOLINT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters