Implement Dynamic GTK Theme Reloading and Monitoring#3605
Open
sabrehagen wants to merge 1 commit intonicotine-plus:masterfrom
Open
Implement Dynamic GTK Theme Reloading and Monitoring#3605sabrehagen wants to merge 1 commit intonicotine-plus:masterfrom
sabrehagen wants to merge 1 commit intonicotine-plus:masterfrom
Conversation
- Added `GLOBAL_CSS_PROVIDER` for centralized CSS management - Refactored CSS loading with `_load_global_css` and `reload_global_css` functions - Introduced theme file monitoring to automatically detect and respond to changes in GTK theme CSS files - Developed functions `_get_theme_search_roots` and `_get_theme_css_files` to identify and manage theme CSS file paths - Implemented `_queue_theme_reload` and `_reload_theme_assets` to handle scheduled theme reloading - Established file monitoring mechanisms with `_on_theme_file_changed` and `_clear_theme_file_monitors` - Initiated theme file monitoring in `start_theme_file_monitoring` and connected theme name changes to `_on_theme_name_changed` for seamless updates - Enhanced logging for better tracking of theme-related events These enhancements improve the application's ability to dynamically update themes, providing a more responsive and user-friendly experience.
Member
|
Thanks for opening a PR. I'm not sure how pywal works, but is there a different way to reload the GTK theme, e.g. by changing the active theme to another one and back? I would rather not carry custom code for theme reloading in Nicotine+, since it feels like something that should live in GTK. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
I am entirely unfamiliar with the nicotine-plus codebase, and largely the python language entirely.
I developed these changes entirely using OpenAI 5.2 to allow soulseek to re-render the UI when I update my gtk theme using pywal. I have tested interactively and all works well.
I submit this code for your review as the project maintainer, and if you believe this concept would be useful for all users of nicotine-plus, I would appreciate feedback on the code such that it may be brought in line with the existing codebase standard, so that it may be merged.
Thank you for your time in review, and for any feedback!
Summary of changes: These enhancements improve the application's ability to dynamically update themes.
GLOBAL_CSS_PROVIDERfor centralized CSS management_load_global_cssandreload_global_cssfunctions_get_theme_search_rootsand_get_theme_css_filesto identify and manage theme CSS file paths_queue_theme_reloadand_reload_theme_assetsto handle scheduled theme reloading_on_theme_file_changedand_clear_theme_file_monitorsstart_theme_file_monitoringand connected theme name changes to_on_theme_name_changedfor seamless updates