-
Notifications
You must be signed in to change notification settings - Fork 37
fix: Application context menu font not changing immediately with font size adjustment #705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
font size adjustment - Also fixed the same issue with sort mode menu, category jump menu, and search box text size --- fix: 应用右键菜单字体没有随着字体大小调整而立即改变 - 同时也修复了排序模式菜单、分类跳转菜单,搜索框文字大小的相同问题 Log: 修复启动器应用右键菜单字体没有谁字体大小调整而立即改变问题 Influence: 启动器菜单文字大小 PMS: BUG-335169
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
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
|
deepin pr auto review这段代码的 diff 显示了对 QML 文件中多个组件(菜单、搜索框等)添加了统一的字体设置 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
总结与修改建议这段代码的主要目的是统一 UI 字体风格,功能上没有问题。为了提高代码的可维护性和健壮性,建议进行以下优化:
修改后的部分代码示例(针对 AppListView.qml): --- a/qml/windowed/AppListView.qml
+++ b/qml/windowed/AppListView.qml
@@ -263,8 +263,7 @@ FocusScope {
modal: true
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
- font: DTK.fontManager.t6
-
+ font: AppStyle.menuFont // 建议使用统一样式
property var existingSections: []
Repeater {
model: ddeCategoryMenu.existingSections
@@ -279,7 +278,6 @@ FocusScope {
alignment: Qt.AlignCenter
text: menuItem.text
color: parent.palette.windowText
- font: ddeCategoryMenu.font
}
background: BoxPanel {
anchors.left: parent.left |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是不是应该 dtkdeclarative 改更合理,按理说所有的 Menu/MenuItem 都应该有相同的行为?
cc @18202781743
| id: categorizedCom | ||
| D.Menu { | ||
| id: categorizedMenu | ||
| font: D.DTK.fontManager.t6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉是启动器这个场景出了问题,像启动器的搜索框弹出的右键菜单也是错误的,但在控制中心就是对的,
启动器的窗口是个PopupWindow,像是没有继承Window的font变化,
and search box text size
fix: 应用右键菜单字体没有随着字体大小调整而立即改变
Log: 修复启动器应用右键菜单字体没有谁字体大小调整而立即改变问题
Influence: 启动器菜单文字大小
PMS: BUG-335169
Summary by Sourcery
Ensure launcher menus and search box text respond immediately to global font size changes across the windowed interface.
Bug Fixes: