Add ActiveEventLoop::system_theme()#3838
Merged
kchibisov merged 2 commits intorust-windowing:masterfrom Aug 5, 2024
Merged
Conversation
Member
Author
|
Considering that |
7 tasks
This was referenced Jul 30, 2024
kchibisov
reviewed
Aug 5, 2024
Fix MacOS returning `None` in `Window::theme()` if no theme override is set, instead it now returns the system theme. MacOS and Wayland were the only ones working correctly according to the documentation, which was an oversight. The documentation was "fixed" now.
kchibisov
approved these changes
Aug 5, 2024
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In #3736 the definition of
Window::theme()was changed to only return theme overrides and never the system theme. Which was only how Wayland worked. MacOS was changed to follow this.However Web and Windows, and MacOS before #3736, currently do return the system theme in
Window::theme()when no theme override is set. The changed definition and behavior currently does not make it possible to get the system theme, which leaves a gap in the API that was previously covered.This PR follows the proposal set in #3837 that reintroduces the old behavior and adds a new
ActiveEventLoop::system_theme()to retrieve the system theme without any window overrides.NSWindow, instead of application-wide #3736).Nonewithout a theme override because it currently doesn't implement querying the system theme.Follow-up to #3736.
Fixes #3837.