-
Notifications
You must be signed in to change notification settings - Fork 86
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
Theme adds support for dicts #518
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #518 +/- ##
==========================================
- Coverage 96.26% 96.25% -0.01%
==========================================
Files 88 88
Lines 12472 12498 +26
==========================================
+ Hits 12006 12030 +24
- Misses 466 468 +2 ☔ View full report in Codecov by Sentry. |
Cool, looks like this could just use a quick unit test of changing a theme by passing in a dictionary instead of a theme file.
You should be able to do this fairly easily in the UIMananger with something like: def load_and_update_theming(theme_file_path: str)
# load theme data
self.ui_theme.load_theme(theme_file_path)
# update UIElements
for sprite in self.ui_group.sprites():
sprite.rebuild_from_changed_theme_data() Or at least it used to work like that at one point because you could edit the theme files while the apps were running and see the changes live. Maybe it still does! |
@MyreMylar update_theming and load_theme seem to be doing the same thing. I want to remove the update_theming method and merge its functionality into the load_theme. update_single_element_theming may also related to it. |
My idea is to save multiple UIAppearanceTheme instances and dynamically replace them at runtime, so there is no need to read files repeatedly. |
just need to add a test for update theming and this should pass. |
Done this. |
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.
OK, LGTM 👍
fixes #400
I found that update_theming and load_theme perform similar functions... Do they need to be refactored?
My other goal is to enable UIManager to dynamically replace ui_theme during runtime. If this is necessary, I may try to do it in the future.