Skip to content
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

Add the option to change the UI Theme at runtime #2693

Merged
merged 35 commits into from
Sep 20, 2024

Conversation

Marterich
Copy link
Contributor

@Marterich Marterich commented Sep 7, 2024

Type of Change

  • New feature
  • UI/UX improvement

Description

This PR Adds a new Button to Switch from Light to Dark Mode at runtime.
Winutil will persist the setting across reboots and start with the latest theme used.
Live Theme Chagne

Impact

As this PR completely overhauls how the Properties for the UI Elements are stored (now as Resource Objects), it touches almost EVERY UI Element. Still, IMHO this creates a good foundation to unify how we handle properties like colors in the future in a scalable, maintainable way.

Testing

Tested on Win11
Please test thoroughly as this revamps many of the UI internals and might have missed something.

Issue related to PR

Additional Information

I simplified the themes (completely removed the pulsing) and decided to keep only a Light and a Dark Theme. This can be easily extended in the future, for example, to allow more than 2 Themes or even Custom Themes that the user can modify.

  • Check if it's possible to reimplement the pretty Togglebuttonstyles
  • Rename _default to "Lite" and recreate a section and logic in the json and ps1 to hold common settings
  • Check what logic in Set-WinUtilUITheme is needed (e.g. loading themes to a PSObject)
  • Check it the other options (font sizes etc.) can also be loaded as a Resource
  • Make the Theme change persistent across app reboots
  • Unify / optimize coding style and cleanup tasks
  • Document Changes

@Marterich Marterich marked this pull request as draft September 7, 2024 22:08
@Marterich Marterich mentioned this pull request Sep 8, 2024
@Marterich Marterich marked this pull request as ready for review September 16, 2024 12:09
@SHR1SHAK
Copy link
Contributor

SHR1SHAK commented Sep 16, 2024

Hey Marterich
Just tested this and the refactor is much easy to customize now. The redundant values were removed that a plus point but seems that the changes made in #2722 were not implemented.
Also instead of light and dark theme switch there should be option to switch between themes

@Marterich
Copy link
Contributor Author

Hey Marterich Just tested this and the refactor is much easy to customize now. The redundant values were removed that a plus point but seems that the changes made in #2722 were not implemented. Also instead of light and dark theme switch there should be option to switch between themes

I've reimplemented the Theme changes you referenced.
Regarding a Dropdown menu or something to manually select the Theme, I would mark this up as "future development potential for a later PR"

@ChrisTitusTech ChrisTitusTech merged commit 0251757 into ChrisTitusTech:main Sep 20, 2024
1 check passed
@Marterich Marterich deleted the dynamic-theming branch October 3, 2024 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Button theme
3 participants