fix(vnote): fix Tibetan text overflow in notebook list headers#399
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts list header heights and layout based on font metrics to prevent Tibetan text clipping in folder and sticky-note headers while preserving original design baselines. 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:
- In FolderListView.qml,
folderItemFontMetricsis using the default font whilefolderNameLabelmay have its own font configuration; consider binding theFontMetrics.fonttofolderNameLabel.fontsoitemHeighttruly reflects the label’s actual glyph metrics. - In ItemListView.qml, the
FontMetricsobject is declared inside thedelegatefor each section header; if this list can be large, consider moving a sharedFontMetricsinstance outside the delegate and reusing it to avoid creating many metric objects.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In FolderListView.qml, `folderItemFontMetrics` is using the default font while `folderNameLabel` may have its own font configuration; consider binding the `FontMetrics.font` to `folderNameLabel.font` so `itemHeight` truly reflects the label’s actual glyph metrics.
- In ItemListView.qml, the `FontMetrics` object is declared inside the `delegate` for each section header; if this list can be large, consider moving a shared `FontMetrics` instance outside the delegate and reusing it to avoid creating many metric objects.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Keep original font sizes and design specs, and make list section header height adapt to actual glyph metrics to prevent clipping of Tibetan text in "Sticky Notes" and notebook header rendering. 保持原有字号与设计规格不变,通过字体度量驱动分组头高度自适应, 修复藏语环境下“已置顶”和记事本标题出现重叠、裁切和出格问题。 Log: 修复藏语下置顶分组与记事本标题显示异常 PMS: BUG-290741 Influence: 藏语切换后列表标题与置顶分组显示恢复正常,且不影响 中文场景下的既有字号和30px设计基线。
b5ea815 to
17f899f
Compare
deepin pr auto review★ 总体评分:100分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 示例:展示当前正确的自适应高度与垂直居中实现模式
import org.deepin.dtk.style 1.0 as DS
Item {
id: root
// 使用 readonly 防止外部意外修改,基于样式系统计算内边距
readonly property int itemVerticalPadding: (DS.Style.control.padding - DS.Style.control.borderWidth) * 2
// 使用 FontMetrics 获取真实字体高度,结合 Math.max 确保最小可用高度
property int itemHeight: Math.max(30, folderItemFontMetrics.height + itemVerticalPadding)
FontMetrics {
id: folderItemFontMetrics
}
Rectangle {
height: root.itemHeight
clip: true // 防止内容溢出圆角边界
RowLayout {
anchors.fill: parent
Label {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.alignment: Qt.AlignVCenter
text: "自适应文本"
}
Label {
Layout.alignment: Qt.AlignVCenter
text: "右侧内容"
}
}
}
} |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dengzhongyuan365-dev, lzwind 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 |
|
This pr force merged! (status: unstable) |
1efe47d
into
linuxdeepin:develop/snipe
Keep original font sizes and design specs, and make list section header height adapt to actual glyph metrics to prevent clipping of Tibetan text in "Sticky Notes" and notebook header rendering.
保持原有字号与设计规格不变,通过字体度量驱动分组头高度自适应,
修复藏语环境下“已置顶”和记事本标题出现重叠、裁切和出格问题。
Log: 修复藏语下置顶分组与记事本标题显示异常
PMS: BUG-290741
Influence: 藏语切换后列表标题与置顶分组显示恢复正常,且不影响
中文场景下的既有字号和30px设计基线。
Summary by Sourcery
Adapt list headers and folder list items to font metrics to prevent Tibetan text clipping while preserving existing design baselines.
Bug Fixes:
Enhancements: