Skip to content

Fixed the font update functionality for not yet created dialogs - #139

Open
Raihan93-coder wants to merge 1 commit into
BusKill:devfrom
Raihan93-coder:Font-update-functionality
Open

Fixed the font update functionality for not yet created dialogs#139
Raihan93-coder wants to merge 1 commit into
BusKill:devfrom
Raihan93-coder:Font-update-functionality

Conversation

@Raihan93-coder

@Raihan93-coder Raihan93-coder commented Jul 20, 2026

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

INFO: No unicode characters found in PR's commits

(source)

@github-actions

Copy link
Copy Markdown

INFO: No unicode characters found in PR's commits

(source)

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