mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: support systemPreferences.isDarkMode() on Windows (#19217)
* add support for isDarkMode on Windows * use NativeTheme for darkmode detection
This commit is contained in:
committed by
Shelley Vohr
parent
4439249617
commit
da672a3b5c
@@ -10,6 +10,7 @@
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "ui/gfx/animation/animation.h"
|
||||
#include "ui/gfx/color_utils.h"
|
||||
#include "ui/native_theme/native_theme.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
@@ -30,7 +31,7 @@ SystemPreferences::~SystemPreferences() {
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
bool SystemPreferences::IsDarkMode() {
|
||||
return false;
|
||||
return ui::NativeTheme::GetInstanceForNativeUi()->SystemDarkModeEnabled();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user