Fixed the font update functionality for not yet created dialogs - #139
Open
Raihan93-coder wants to merge 1 commit into
Open
Fixed the font update functionality for not yet created dialogs#139Raihan93-coder wants to merge 1 commit into
Raihan93-coder wants to merge 1 commit into
Conversation
|
INFO: No unicode characters found in PR's commits (source) |
|
INFO: No unicode characters found in PR's commits (source) |
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.
Problem
The
update_font_recursive()function updates the font of widgets that already exist in the widget tree. However, DialogConfirmation instances are created lazily they are only instantiated when the user opens dialogs such as About, Check for Updates, etc.Because these dialogs do not exist when update_font_recursive() is initially executed, their widgets are skipped and continue using the previous font. As a result, dialogs opened after changing the font do not reflect the newly selected font.
Solution
To ensure newly created dialogs always use the current application font, a font update is triggered from the DialogConfirmation constructor.
The update is scheduled using
Clock.schedule_once(...)instead of calling update_font_recursive() directly. This ensures the dialog has been fully constructed and all child widgets have been added before recursively updating their fonts. Calling the function immediately during construction would occur too early ( Did that and some weird things like partially font uodated dialogs and all was present ), before the widget tree is complete.This change guarantees that every newly created dialog automatically adopts the currently configured font without requiring any additional updates elsewhere in the application.
This is a solution to the issue #138 but the issue of font listing not updating for some or the other reason is not popping up I wrote this solution for the About and Update session not for the Font list, but for some or the other reason I find it fixed when I run the program