-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[Settings]Takes some time to adapt to theme change #26791
Comments
I notice that only the General page triggers the switch, so... PowerToys/src/settings-ui/Settings.UI/SettingsXAML/Views/GeneralPage.xaml.cs Lines 92 to 115 in 187f0e3
This code must be "app-scope" |
@niels9001 it really is best practice to leave absolutely as much as possible to the framework/SDK. In other words: remove as much "manual" code as possible. |
It should work by default.. but theme changing at runtime has been a pain point for a long, long time. The theming stuff we are doing turned out to be a spaghetti - and we are making registry edits to make things work. It's not the way, yet there isn't a great one :-). Let's leave it at prio3 though - it only happens on theme change within the app which is not a common thing and navigating to a different page solves it. |
And it does - if only we stop making so much spaghetti! (I don't even like spaghetti)
There is - like I said: Let the framework/sdk/winui/whateverthenameis do its thing. #LessIsMore! @niels9001 I am literally showing you what/where the problem is. Why can't you accept that? |
As far as I am aware, there's is no out-of-the-box way to set the So.. it's not an easy thing that we somehow decided to make more complicated 😊.
I think the code you mentioned gets triggered whenever the ViewModel on the General page gets/sets the theme (e.g. on page load or when the user selects the theme option).. That's the reason why navigating from and back to the General page triggers that method and applies the correct theme.
If I recall correctly, I think that works but we get the wrong theme passed - not sure though.. I know I struggled a lot to get #25936 in a workable state due to this (although I'm pretty sure I tested this scenario as well so this is surprising to see). If you have any code suggestions on how to fix this, please let it be known in this thread! (Or feel free to PR the solution 😁)
In my earlier comment, I tried to explain what's the root cause of why these theme related bugs pop-up across various WinUI3 modules. Not sure how that is "not accepting" things? I just mentioned that this is not a 'medium' bug but a Prio3 as @jaimecbernardo tagged it to be (it's not a common scenario an average user would run into nor is it a blocking/crashing bug). I just wanted to point out that there's a more complex root issue causing this and that this is not a straight-forward thing to fix - hopefully my explanation in this comment is more clear, but it takes a lot of time to write these things down. Point of note: at times you come off as lecturing people on why things/code aren't the way they should be, or making snarky remarks. Yeah, people and the code they write ain't perfect (definitely this codebase isn't :-)). I'm sure you don't mean it that way, but please take that in mind and check out our Code of Conduct. We are all friends here! |
The work associated with this issue has been released as part of the 0.76 sprint. Please update PowerToys to the latest. https://github.com/microsoft/PowerToys/releases |
Microsoft PowerToys version
0.71.0-pre
Installation method
Dev build in Visual Studio
Running as admin
None
Area(s) with issue?
Settings
Steps to reproduce
After #25936 , when changing the windows theme with the Settings page opened, it takes a bit to adapt to the theme change.
✔️ Expected Behavior
The Settings window reacts to the theme change.
❌ Actual Behavior
The Settings window won't react to the theme change unless you use its UI for a bit.
Other Software
Tested on Windows 11 only, but I assume Windows 10 might have issues too.
The text was updated successfully, but these errors were encountered: