Skip to content

Conversation

@re2zero
Copy link
Contributor

@re2zero re2zero commented Feb 9, 2026

Set renderType to Text.QtRendering for all Text elements in notification content to fix faint font strokes at 4K 150% scaling.

修复通知中心在高DPI缩放下的字体渲染问题,为所有文本元素设置Qt渲染模式。

Log: 修复高DPI缩放下字体渲染问题
PMS: BUG-345405
Influence: 在4K 150%缩放下,通知文字的笔画(如"开"字的竖笔)现在显示清晰,与控制中心等其他控件的渲染效果保持一致。

Summary by Sourcery

Bug Fixes:

  • Fix faint or unclear notification text strokes on 4K displays with 150% scaling by using Qt text rendering for all notification text elements.

@sourcery-ai
Copy link

sourcery-ai bot commented Feb 9, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Sets all text elements in the notification item content to use Qt-based text rendering to fix faint font strokes at high DPI scaling, and cleans up a minor layout expression whitespace issue.

File-Level Changes

Change Details Files
Standardize text rendering in notification content using Qt rendering to improve clarity at high DPI.
  • Set the app name Text element to use Qt-based text rendering
  • Set the date Text element to use Qt-based text rendering
  • Set the notification title Text element to use Qt-based text rendering
  • Set the notification body Text element to use Qt-based text rendering
panels/notification/plugin/NotifyItemContent.qml
Minor layout expression formatting cleanup.
  • Remove trailing whitespace in the Layout.preferredWidth calculation expression
panels/notification/plugin/NotifyItemContent.qml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a 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:

  • Since renderType: Text.QtRendering is now required for consistent notification text rendering, consider moving this into a shared text style or base component used by notifications so it’s applied uniformly and future additions don’t have to remember to set it manually.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since `renderType: Text.QtRendering` is now required for consistent notification text rendering, consider moving this into a shared text style or base component used by notifications so it’s applied uniformly and future additions don’t have to remember to set it manually.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

18202781743
18202781743 previously approved these changes Feb 9, 2026
@18202781743
Copy link
Contributor

18202781743 commented Feb 9, 2026

Uploading 截图_选择区域_20260209155243.png…

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, re2zero

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Set renderType to Text.QtRendering for all Text elements in notification
content to fix faint font strokes at 4K 150% scaling.

修复通知中心在高DPI缩放下的字体渲染问题,为所有文本元素设置Qt渲染模式。

Log: 修复高DPI缩放下字体渲染问题
PMS: BUG-345405
Influence: 在4K 150%缩放下,通知文字的笔画(如"开"字的竖笔)现在显示清晰,与控制中心等其他控件的渲染效果保持一致。
@deepin-ci-robot
Copy link

deepin pr auto review

这段代码修改涉及到了QML中Text元素的渲染方式设置以及一些格式调整。以下是对该diff的详细审查意见:

1. 语法逻辑

  • renderType设置:在多处Text元素中添加了renderType: Text.QtRendering。这个修改在语法上是正确的,QtRendering是QML Text元素支持的渲染类型之一。
  • 版权年份更新:将SPDX版权声明从"2024"更新为"2024 - 2026",这是合理的做法,表示版权保护期限的延长。

2. 代码质量

  • 格式一致性:修复了一处行尾空格问题(第284行),这是好的实践,符合代码格式规范。
  • 渲染类型一致性:为所有Text元素统一添加了renderType属性,提高了代码的一致性。

3. 代码性能

  • 渲染性能考虑
    • Text.QtRendering使用Qt的默认渲染引擎,通常能提供较好的文本渲染质量。
    • 但在某些情况下(特别是大量文本元素时),Text.NativeRendering可能性能更好,因为它使用平台的原生文本渲染API。
    • 如果通知面板中有大量文本元素,建议测试不同渲染类型的性能表现。

4. 代码安全

  • 渲染类型选择
    • Text.QtRendering是跨平台一致的渲染方式,不会因平台不同而出现渲染差异,这对于UI一致性是有利的。
    • 但在某些旧版本Qt中,QtRendering可能存在已知的安全问题或渲染bug,建议确保使用的Qt版本已经修复了这些问题。

改进建议:

  1. 考虑使用条件渲染类型
renderType: Qt.styleHints.useRtlExtensions ? Text.QtRendering : Text.NativeRendering

这样可以根据平台特性选择更合适的渲染方式。

  1. 添加注释说明
    建议为renderType的添加添加注释,说明为什么选择QtRendering而不是其他选项:
// 使用Qt渲染引擎以确保跨平台文本一致性
renderType: Text.QtRendering
  1. 性能测试
    建议对修改后的代码进行性能测试,特别是在显示大量通知时的性能表现。

  2. 考虑使用样式表
    如果项目中已经定义了统一的文本样式,建议将renderType等通用属性提取到样式表中,而不是在每个Text元素中重复设置。

  3. 字体渲染质量测试
    由于改变了渲染类型,建议在不同平台(特别是Linux不同发行版)上进行测试,确保文本渲染质量符合预期。

总体来说,这个修改主要是为了统一文本渲染方式,提高跨平台一致性,但需要注意性能和渲染质量的权衡。建议在实际使用中进行充分测试。

@re2zero
Copy link
Contributor Author

re2zero commented Feb 9, 2026

/merge

@deepin-bot
Copy link

deepin-bot bot commented Feb 9, 2026

This pr cannot be merged! (status: unstable)

@re2zero
Copy link
Contributor Author

re2zero commented Feb 9, 2026

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented Feb 9, 2026

This pr force merged! (status: unstable)

@deepin-bot deepin-bot bot merged commit d9b99ad into linuxdeepin:master Feb 9, 2026
10 of 11 checks passed
@re2zero re2zero deleted the bugfix branch February 9, 2026 08:28
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.

3 participants