-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Accent color and dark mode platform settings #9913
Conversation
42165b8
to
f01ea6a
Compare
You can test this PR using the following package version. |
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, other than a couple comments. I've tested it on windows 11 and android, and it works as described.
For better accessibility, how about adding a |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
@maxkatz6 It seems ColorValuesChanged event failed to fire when dark mode settings changed. Using the latest Avalonia nightly build with Windows 11 22H2. |
@laolarou726 can you debug if WM_SETTINGCHANGE in Win32Platform.WndProc is raised for you? |
Instead of WM_SETTINGCHANGE we can handle WinRT UISettings.ColorValuesChanged COM event. But writing a com wrapper for that will be more time-consuming comparing to WM_SETTINGCHANGE which also should just work. |
I'm also using the same system version, the event will fire when accent color changed. But not when dark mode settings changed? How should I capture WM_SETTINGCHANGE message? |
nvm, I made a stupid mistake. The event is perfectly fine. Sorry about that. |
What does the pull request do?
This PR implements new low-level API for next features:
New low-level API:
(Higher level API will come later in 11.0, at least for dark theme, see #8166, where this API will be actively used)
Platform details
Windows
Straightforward implementation. But only Win10 supported for reasons of maintability.
win.mp4
macOS
Also, a straightforward implementation. But a bit painful with all of these Obj C.
Note, this video is recorded from another branch (ThemeDictionary one), but it uses the same low level implementation as here.
mac.mp4
Linux (FreeDesktop)
Only works if distro implements newest (~2021) standard of FreeDesktop. GTK and others specific settings are ignored.
Accent colors are not supported, and frame theme isn't changeable from the app (not sure if it's possible, if anybody wants to help - please do).
No high contrast support.
lin.mp4
Browser
Only preferred dark mode changes API is implemented. There is no readable accent colors API in the web standard.
wasm.mp4
Android
Dark mode, accent colors (up to three different accent colors) are supported.
Status bar color changes are not there, as we don't have ready API for the status bar anyway.
android.mp4
iOS
Status bar status is the same as with android.
There is no video, "just trust me, it works".
Fixed issues
Fixes #4026
Fixes #9560
Fixes #3695