-
Notifications
You must be signed in to change notification settings - Fork 15k
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
feat: add new nativeTheme API #19656
Conversation
Now we're talking 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of nits 😆 - super sorry. Additionally:
- Did you miss
module-keys.js
or isn't it used anymore? nativeTheme.shouldUseInvertedColorScheme
doesn't work on macOS for me (always false), butupdate
event gets fired when I toggle it- Afaik, the
nativeTheme
methods on Linux aren't implemented and default to some value - we should state that - Oh and we have some fake tests for the
sysPref
methods - do we wanna move them to a newnativeThemeSpec
?
This API is only implemented on Windows inside Chromium, it's a one liner to implement on macOS so I'll do that here as well.
Potentially, will have to review which APIs are implemented for linux 👍
New tests should be added here that the APIs "work" |
…or of new nativeTheme module
2828210
to
a88f572
Compare
a88f572
to
18dfc61
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚢
Release Notes Persisted
|
I have automatically backported this PR to "7-0-x", please check out #19758 |
Just updated today and didn't even know this was coming, awesome 🙌 |
This adds a new
nativeTheme
API which extracts APIs fromsystemPreferences
(which was becoming a bit of a dumping ground) and consolidates them all to be backed by Chromium'sNativeTheme
module which is better implemented, more resilient and means we don't have to maintain the theme code 👍It also allows us to easily implement the
updated
event.Notes: Added new
nativeTheme
API to read and respond to changes in the OS's theme and color scheme