fix: The font size of the category jump menu does not adjust with the system font size when sorting by category#705
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideBinds various launcher menus and the search box to the shared DTK font manager so their text size updates immediately when the global font size changes. Sequence diagram for launcher font size change propagationsequenceDiagram
actor User
participant SettingsApp
participant DTK_fontManager
participant AppItemMenus
participant CategoryMenus
participant SearchBox
User->>SettingsApp: changeFontSize(newSize)
SettingsApp->>DTK_fontManager: setFontSize(newSize)
DTK_fontManager-->>DTK_fontManager: update_t6_font
DTK_fontManager-->>AppItemMenus: notify_font_changed(t6)
DTK_fontManager-->>CategoryMenus: notify_font_changed(t6)
DTK_fontManager-->>SearchBox: notify_font_changed(t6)
AppItemMenus-->>AppItemMenus: font bound to DTK_fontManager.t6
CategoryMenus-->>CategoryMenus: font bound to DTK_fontManager.t6
SearchBox-->>SearchBox: font bound to DTK_fontManager.t6
AppItemMenus-->>User: menu text size updated
CategoryMenus-->>User: sort and category menu text size updated
SearchBox-->>User: search text size updated immediately
Flow diagram for DTK font manager bindings in launcher componentsflowchart LR
DTK_fontManager_t6[DTK_fontManager.t6]
DTK_fontManager_t6 --> AppItemMenu_font
DTK_fontManager_t6 --> DummyAppItemMenu_font
DTK_fontManager_t6 --> CategoryMenu_font
DTK_fontManager_t6 --> CategoryMenu_label_font
DTK_fontManager_t6 --> SearchBox_font
AppItemMenu_font[AppItemMenu D.Menu font]
DummyAppItemMenu_font[DummyAppItemMenu D.Menu font]
CategoryMenu_font[SideBar categorizedMenu font]
CategoryMenu_label_font[AppListView category label font]
SearchBox_font[BottomBar searchEdit font]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- There’s an inconsistency in how the font manager is referenced (
DTK.fontManager.t6vsD.DTK.fontManager.t6inSideBar.qml); consider aligning on a single import/alias pattern to avoid confusion and future mistakes. - You’re now repeating
font: DTK.fontManager.t6across several components; consider introducing a shared style or wrapper component for menus/search inputs to centralize this binding and make future font changes easier.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- There’s an inconsistency in how the font manager is referenced (`DTK.fontManager.t6` vs `D.DTK.fontManager.t6` in `SideBar.qml`); consider aligning on a single import/alias pattern to avoid confusion and future mistakes.
- You’re now repeating `font: DTK.fontManager.t6` across several components; consider introducing a shared style or wrapper component for menus/search inputs to centralize this binding and make future font changes easier.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In SideBar.qml you’re using
D.DTK.fontManager.t6while the other files useDTK.fontManager.t6; consider aligning the namespace usage to avoid subtle runtime binding issues.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In SideBar.qml you’re using `D.DTK.fontManager.t6` while the other files use `DTK.fontManager.t6`; consider aligning the namespace usage to avoid subtle runtime binding issues.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
BLumia
left a comment
There was a problem hiding this comment.
这个是不是应该 dtkdeclarative 改更合理,按理说所有的 Menu/MenuItem 都应该有相同的行为?
cc @18202781743
qml/windowed/SideBar.qml
Outdated
| id: categorizedCom | ||
| D.Menu { | ||
| id: categorizedMenu | ||
| font: D.DTK.fontManager.t6 |
There was a problem hiding this comment.
感觉是启动器这个场景出了问题,像启动器的搜索框弹出的右键菜单也是错误的,但在控制中心就是对的,
启动器的窗口是个PopupWindow,像是没有继承Window的font变化,
|
TAG Bot New tag: 2.0.27 |
|
TAG Bot New tag: 2.0.28 |
|
TAG Bot New tag: 2.0.29 |
|
TAG Bot New tag: 2.0.30 |
9353f11 to
3d6d275
Compare
with the system font size when sorting by category --- fix: 按分类排序时,分类跳转菜单字体大小不随系统字体大小调整而改变问题 Log: 修复按分类排序时,分类跳转菜单字体大小不随系统字体大小调整而改变问题 Influence: 启动器分类跳转菜单文字大小 PMS: BUG-335169
3d6d275 to
c2ec224
Compare
deepin pr auto review这段代码的修改主要涉及 QML 中 UI 组件的字体样式设置。以下是对这段 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
总结与改进建议这段代码修改本身是正确且规范的,主要是为了适配 DDE 的设计规范。为了进一步提升代码质量,建议考虑以下改进:
改进后的代码片段示例(仅供参考): MenuItem {
id: menuItem
text: getCategoryName(modelData)
textColor: DStyle.Style.menu.itemText
// 使用 DTK 统一字体管理
font: DTK.fontManager.t6
onTriggered: {
scrollToDDECategory(modelData)
}
// 假设这是 contentItem 中的 Label
Label {
alignment: Qt.AlignCenter
text: menuItem.text
color: parent.palette.windowText
// 继承字体设置
font: menuItem.font
}
// ...
} |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, electricface 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 |
|
/forcemerge |
fix: 按分类排序时,分类跳转菜单字体大小不随系统字体大小调整而改变问题
Log: 修复按分类排序时,分类跳转菜单字体大小不随系统字体大小调整而改变问题
Influence: 启动器分类跳转菜单文字大小
PMS: BUG-335169