-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Added flyout theme setting #24169
base: main
Are you sure you want to change the base?
Added flyout theme setting #24169
Conversation
@BLM16 Doesn't it make more sense to bind the fly out on the Settings ui theme setting we already have? |
I thought about that, but there is windows theme and app theme, and I have them set differently. I feel the flout should be separate so people can have it on dark mode while still using a light app theme. Default for my apps is light mode, yet I use windows' dark mode. That is why I have separated them: the settings UI should behave like an app, the flout should behave like a native part of windows. |
I could change it and add a fourth (becoming the default) option to match PT theme. Because it takes no extra effort to make a setting for it, and I see use, I added it. |
What about reading the setting in Registry and let the user switch between "PT Theme" and "OS Theme"? |
That is a good idea. Keep light and dark manual, change the windows default to use windows' OS (not app) theme and add the default option to use PT theme (which would default to the windows app theme anyways)? |
Sounds a bit complex. |
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.
Perfect
I don't quite follow what you mean. What I was thinking was for the flyout theme setting. having the following options:
I would also likely change the App theme dropdown option to say "Windows app theme" instead of "Windows default" because this is more clear which windows theme it is using (since app and os themes both exist). Thoughts on which flyout theme should be the default? |
Let's do it without PT theme. I think if a user want to have it the same he can set both to light or dark.
Sounds good.
Let's have the OS theme as default. |
@BLM16 mind adding a screenshot of the added settings card to the original post so folks can see what's happening there :)? |
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.
Hi, thanks for the contribution!
Seems to function well enough, but after having opened the flyout already once, changing the setting doesn't seem to take effect until PowerToys is restarted.
Other than that and the question from Niels about "AcrylicBackgroundFillColorDefaultBrush" being needed, it looks good to me!
I commented on the restart still being required and it is part of the TODO for this PR. I need to get that sorted out first. |
Added in the PR description up top. |
Having the same card twice couls be confusing. What about having an SettingsExpander instead? You can move the Flyout SettingsCard into the SettingsExpander.Items and remove the icon (and description I guess) |
Updated. See the edited image up top. |
At this point, the flyout theme change works as expected. There is still a very brief flash of white before the dark theme takes effect when opening the flyout that I cannot seem to figure out. |
Two questions:
The FlyoutWindow has the right Acrylic recipe defined ( Might be that the flashing happens because the acrylic of the window gets loaded first (and is not adjusted to the theme)? Either way, I think there are two options
See: (
|
What do you mean by this? Change the acrylic to be on the The reason the acrylic is currently applied to the ShellPage is because this combines with the LayerOnAcrylicFillColorDefaultBrush of the LaunchPage and AppsListPage to create a lighter color than the bottom bar. This is similar to the slight difference in color on the toolbar of the win11 action center. PowerToys/src/settings-ui/Settings.UI/Flyout/LaunchPage.xaml Lines 29 to 32 in f85fc98
|
Hang on, sorry. I see what you are meaning. I will look into that shortly. Not sure how I missed that previously but it looks like I would have saved a bunch of trouble if I saw that. |
@niels9001 The correct acrylic brush should be used now. Thanks for pointing that out! The brief flash is also now fixed when handling the theme change from the base window rather than the shell page. The WinUIEx base theme was temporarily overriding the shell page when it was changing states. The "ShellPage" is still handling the theme change, however it is the main window controlling this. WinUIEx doesn't give the option to manually set the |
Yes, all the tooltips are rendered in the correct theme for the modules and other buttons. Their acrylics render as expected. |
Hmm.. we're still setting the acrylic brush twice, right? Looks like Without With But, removing it causes this when switching from dark to light theme: But works with @BLM16 Would it make sense to just restart PowerToys to update this setting.. that should work, right? Changing themes of UWP/WinUI has always been a pain :(.. Thoughts? |
@BLM16 Btw, we ran into the same issue with adding Mica to the Settings page - when switching themes the backdrop is gone and things don't render correctly. So if we can figure it out here we can solve it for Settings as well 😊! |
I will look into this and a few other solutions to see what is best. Good catch on the acrylic. |
302f1a9
to
ca81d5d
Compare
I have fixed the acrylic not showing colors from behind. The acrylic should now work for both themes and everything appears to function as expected. |
I just wanted to follow up on this and see if anything else is missing from this PR that is preventing it from getting merged. Any updates would be appreciated 🙂! |
@niels9001 Could you take a look? Thanks I can help with merge conflicts |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Using VS I somehow messed up the rebase a while back and now many of these files diverge or have been "added" from main. I wonder if somehow I switched from a rebase to a merge halfway through? Is there a clean way to fix this outside of completely resetting this to main and adding the commits again? |
Not sure. Might be easier to start from the clean current main and cherry-pick your commits one by one. Either that or merge current main here and resolve reported conflicts |
915b749
to
b17aaf1
Compare
This comment has been minimized.
This comment has been minimized.
b17aaf1
to
a236adc
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.
Copilot reviewed 5 out of 14 changed files in this pull request and generated no comments.
Files not reviewed (9)
- src/runner/general_settings.cpp: Language not supported
- src/runner/general_settings.h: Language not supported
- src/settings-ui/Settings.UI/SettingsXAML/Flyout/LaunchPage.xaml: Language not supported
- src/settings-ui/Settings.UI/SettingsXAML/Flyout/ShellPage.xaml: Language not supported
- src/settings-ui/Settings.UI/SettingsXAML/FlyoutWindow.xaml: Language not supported
- src/settings-ui/Settings.UI/SettingsXAML/Views/GeneralPage.xaml: Language not supported
- src/settings-ui/Settings.UI/SettingsXAML/Views/PowerLauncherPage.xaml: Language not supported
- src/settings-ui/Settings.UI/Strings/en-us/Resources.resw: Language not supported
- src/common/ManagedCommon/ThemeHelpers.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)
src/settings-ui/Settings.UI/ViewModels/GeneralViewModel.cs:394
- The FlyoutThemeIndex property does not have explicit test coverage. Add tests to ensure its correct behavior.
public int FlyoutThemeIndex
Summary of the Pull Request
Adds the ability to toggle the flyout between dark and light mode. Closes #23831.
PR Checklist
TODO
Validation Steps Performed