fix: bind fontManager to dialog labels/buttons for realtime font size update - #329
fix: bind fontManager to dialog labels/buttons for realtime font size update#329robertkill wants to merge 2 commits into
Conversation
…size update UpdateSelectDialog.qml and QuitTestingChannelDialog.qml used D.DialogWindow (a standalone top-level window) without binding components to D.DTK.fontManager, so their font sizes did not follow system font size changes in real time and required restarting dde-control-center to take effect. - UpdateSelectDialog.qml: add font: D.DTK.fontManager.t8 to the D.Label, font: D.DTK.fontManager.t6 to the ButtonWithToolTip D.Button - QuitTestingChannelDialog.qml: add font: D.DTK.fontManager.t8 to the Label, font: D.DTK.fontManager.t6 to D.Button and D.RecommandButton Font sizes (t8 for content text, t6 for buttons) match the convention already used in UpdateControl.qml and UpdateHistoryDialog.qml. Issue: DDE-70
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: robertkill The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideBinds dialog text labels and buttons in update-related QML dialogs to DTK's fontManager so their font sizes react to system font size changes in real time, aligning typography with existing module conventions. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…lDialog Fix SPDX CI check failure: the copyright header only listed 2025, update to '2025 - 2026' to match the convention used in other files in this module (e.g. UpdateSelectDialog.qml). Ref: DDE-70
deepin pr auto review★ 总体评分:100分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // UpdateSelectDialog.qml:确保自定义 contentItem 的字体属性正确传递
component ButtonWithToolTip: D.Button {
id: customButton
font: D.DTK.fontManager.t6
contentItem: Text {
id: buttonText
text: customButton.text
font: customButton.font // 建议显式绑定,确保外部 t6 字体设置生效
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
// ... 其他原有属性
}
} |
Problem
更新方式选择弹窗(UpdateSelectDialog)和退出测试通道弹窗(QuitTestingChannelDialog)的字号不会跟随系统字号修改实时变更,需要重启控制中心才能生效。
根因:两个对话框都使用
D.DialogWindow(独立顶层窗口),其窗口字体在创建时确定,不会随系统字号变更自动更新。文件中的D.Label/Label和D.Button/D.RecommandButton均未绑定D.DTK.fontManager,因此字号被冻结在创建时的状态。Changes
src/dcc-update-plugin/qml/UpdateSelectDialog.qmlD.Label添加font: D.DTK.fontManager.t8ButtonWithToolTip内的D.Button添加font: D.DTK.fontManager.t6src/dcc-update-plugin/qml/QuitTestingChannelDialog.qml(同类问题)Label添加font: D.DTK.fontManager.t8D.Button/D.RecommandButton添加font: D.DTK.fontManager.t6字号选择(t8 用于内容文字、t6 用于按钮)与同模块
UpdateControl.qml、UpdateHistoryDialog.qml中已有的约定一致。Testing
Ref: DDE-70
Summary by Sourcery
Bind dialog labels and buttons in update-related QML dialogs to the global font manager so their font sizes update in real time with system font changes.
Bug Fixes: