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

Fix inconsistent theme on first launch and restart #30

Merged
merged 3 commits into from
Sep 21, 2022
Merged

Fix inconsistent theme on first launch and restart #30

merged 3 commits into from
Sep 21, 2022

Conversation

DavG25
Copy link
Contributor

@DavG25 DavG25 commented Sep 21, 2022

Tested on Windows 10 version 21H1, should to be tested on Windows 11 to make sure the option Use system setting under Theme Mode works correctly

  • The method to get the current system theme has been changed, the previously used _theme.GetSystemTheme() returned the Windows mode theme instead of the app mode theme and caused issues when these two values were different (such as the ContentDialog having invisible buttons or text being the wrong color)
    Screenshot

  • The Theme setting will now persist between application restarts

  • Solves Invisible buttons on first execution #29

@DavG25 DavG25 marked this pull request as ready for review September 21, 2022 01:26
@sabihoshi sabihoshi merged commit 2be599e into sabihoshi:main Sep 21, 2022
sabihoshi added a commit that referenced this pull request Sep 21, 2022
* Increment version number
* Fix theme not syncing together when changed
* Fix buttons not changing theme
* Fix font missing

Co-authored-by: sabihoshi <sabihoshi.dev@gmail.com>
@sabihoshi
Copy link
Owner

Thank you! Was not meant to merge it without asking you to test it first, but I did test it on my Windows 10 machine, could you check it up as well? I went back to ui:FontIcon since the theme color wasn't changing until you switch pages, and it seems like all that was missing was the font property Segoe MDL2 Assets which was the font I was using before. There's no need to bundle the font since it's in Windows 10 as well!

sabihoshi added a commit that referenced this pull request Sep 21, 2022
* Increment version number
* Fix theme not syncing together when changed
* Fix buttons not changing theme
* Fix font missing

Co-authored-by: sabihoshi <sabihoshi.dev@gmail.com>
@DavG25
Copy link
Contributor Author

DavG25 commented Sep 21, 2022

Hi, I tested the new build on Windows 10 and your solution works perfectly, the icons/buttons are also the correct size now!

The only minor issue I found was when setting the theme to Use system setting it would change back to either Dark or Light after restarting the application, this seems to be fixed by using Settings.Modify() for the AppTheme only when ToggleTheme() is triggered, like this https://github.com/DavG25/GenshinLyreMidiPlayer/commit/49befd632142a444f0cdd002b9d762a98cae9fab

Thank you again!

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.

2 participants