-
Notifications
You must be signed in to change notification settings - Fork 16.2k
feat: support systemPreferences.isDarkMode()
on Windows
#19217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I want to reiterate on this again #18666 (comment), why aren't we reusing the api from |
Huh... probs bc that would've been too easy 😄. I'll take a closer look at it tmw - looks promising... and even offers an event emitter for theme changes. Maybe we can get Linux support as well and upstream it to Chromium? |
Yeah macOS is the issue there. We could use that api just for Windows support though? |
@codebytere I don't see the reason to patch even if thats the case we could return |
oops my comment somehow deleted but in response to the above, yeah it might just be fine to gate it on mac and use for windows in totality |
494b9b1
to
06cbf62
Compare
Before merging, should I also add a |
@deermichel If we do do a first-party |
You're right, I totally forgot about macOS. Then this PR is ready to get merged 👍 |
Release Notes Persisted
|
Will this make it into Electron 6.0.0? |
Description of Change
Closes #18696. Closes #15316. Adds support for the
systemPreferences.isDarkMode()
API on Windows using Chromium'sNativeTheme
API.Outdated (not-actually-used) approach
Whether the system uses dark or light theme is derived from following registry key:
cc @MarshallOfSound @erickzhao @codebytere
Checklist
npm test
passesRelease Notes
Notes: Added support for
systemPreferences.isDarkMode()
API on Windows.