Skip to content

Conversation

@arx-ein
Copy link
Contributor

@arx-ein arx-ein commented Dec 5, 2025

Overview

Fixed an issue regarding the custom theme feature implemented in #1821
After a custom theme is loaded, some colors will remain unchanged while switching back to other themes.

Details

Here, I first loaded the default "Custom YAML" theme (which is basically identical to the light theme).

fix-custom-theme-remaining-00

Then, when I switch back to a different theme (I used dark theme to make it more obvious), some elements like the title bar or texts change color properly but others like the background color remains the same.

fix-custom-theme-remaining-01

With this PR this will no longer be the case, and all the colors will change accordingly as determined by the themes.

Fixed an issue where after custom theme is once loaded,
some colors will remain unchanged while switching to other themes
@arx-ein
Copy link
Contributor Author

arx-ein commented Dec 5, 2025

The fix now works fine but is more of a temporary one, so consider this WIP as I will work on a better solution.

@arx-ein
Copy link
Contributor Author

arx-ein commented Dec 5, 2025

I've been informed that this PR tackles the same issue as #1852, making this a duplicate, while the changes are different.
I plan to finish my changes nonetheless and compare these afterwards.

- Expose only `Load()` and `ThemeDict()` as public methods
  - `Load()` to trigger `theme.yaml` reload
  - `ThemeDict()` to return `ResourceDictionary` like other themes
- Rewrite `App.axaml.cs` accordingly
- Add `Name` and `IsDarkMode` properties to get info safely
@arx-ein
Copy link
Contributor Author

arx-ein commented Dec 5, 2025

Ended up rewriting CustomTheme altogether but I believe now the code is more concise and safer. I'd mark it ready for review.

@arx-ein arx-ein marked this pull request as ready for review December 5, 2025 22:54
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.

1 participant