Skip to content

fix: fix font weight property assignment#722

Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
18202781743:master
Mar 6, 2026
Merged

fix: fix font weight property assignment#722
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
18202781743:master

Conversation

@18202781743
Copy link
Contributor

@18202781743 18202781743 commented Mar 6, 2026

  1. Changed Font.BoldFont.Bold to Font.Bold in folderNameFont property
    assignment
  2. This fixes a QML warning about incorrect property access
  3. The original code was trying to access a non-existent property chain
  4. Font.Bold is the correct way to specify bold font weight in Qt/QML

Influence:

  1. Verify that folder grid view popup displays with correct bold font
    styling
  2. Check for any remaining QML warnings related to font properties
  3. Test popup appearance and text rendering in different display
    scenarios

fix: 修复字体粗细属性赋值

  1. 将 folderNameFont 属性赋值中的 Font.BoldFont.Bold 改为 Font.Bold
  2. 修复了关于错误属性访问的 QML 警告
  3. 原始代码尝试访问不存在的属性链
  4. Font.Bold 是在 Qt/QML 中指定粗体字重的正确方式

Influence:

  1. 验证文件夹网格视图弹窗是否以正确的粗体字体样式显示
  2. 检查是否还有与字体属性相关的 QML 警告
  3. 在不同显示场景下测试弹窗外观和文本渲染

Summary by Sourcery

Bug Fixes:

  • Fix incorrect font weight property reference that triggered a QML warning and prevented proper bold styling in the folder grid view popup.

1. Changed Font.BoldFont.Bold to Font.Bold in folderNameFont property
assignment
2. This fixes a QML warning about incorrect property access
3. The original code was trying to access a non-existent property chain
4. Font.Bold is the correct way to specify bold font weight in Qt/QML

Influence:
1. Verify that folder grid view popup displays with correct bold font
styling
2. Check for any remaining QML warnings related to font properties
3. Test popup appearance and text rendering in different display
scenarios

fix: 修复字体粗细属性赋值

1. 将 folderNameFont 属性赋值中的 Font.BoldFont.Bold 改为 Font.Bold
2. 修复了关于错误属性访问的 QML 警告
3. 原始代码尝试访问不存在的属性链
4. Font.Bold 是在 Qt/QML 中指定粗体字重的正确方式

Influence:
1. 验证文件夹网格视图弹窗是否以正确的粗体字体样式显示
2. 检查是否还有与字体属性相关的 QML 警告
3. 在不同显示场景下测试弹窗外观和文本渲染
@sourcery-ai
Copy link

sourcery-ai bot commented Mar 6, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR corrects a QML font-weight property usage in the windowed launcher folder grid view popup to use the proper Qt/QML bold enumeration, eliminating a warning and ensuring correct bold rendering.

File-Level Changes

Change Details Files
Fix incorrect QML font-weight property usage for the folder grid view popup.
  • Update folderNameFont assignment to call LauncherController.adjustFontWeight with Font.Bold instead of the invalid Font.BoldFont.Bold enum chain
  • Ensure the folder grid view popup uses the correct bold font styling and no longer triggers QML warnings about invalid property access
qml/windowed/WindowedFrame.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 reviewed your changes and they look great!


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.

@deepin-ci-robot
Copy link

deepin pr auto review

针对这段 QML 代码的 git diff,我提供以下详细的代码审查意见:

1. 语法逻辑与规范审查

  • 修改内容分析
    • 原代码Font.BoldFont.Bold
    • 新代码Font.Bold
  • 审查结论逻辑正确,符合规范
    • 在 QML 中,Font 是一个全局对象,用于定义字体属性。Font.Bold 是标准的枚举值,代表粗体。
    • 原代码中的 Font.BoldFont.Bold 这种写法看起来像是一个错误的嵌套引用或者是某种特定的自定义枚举路径,但在标准 QML QtQuick 模块中,BoldFont 并不是 Font 对象的标准属性。因此,将其修改为标准的 Font.Bold 是正确的语法修正。

2. 代码质量审查

  • 可读性提升
    • Font.Bold 是 QML 开发者通用的写法,一眼就能识别出是设置字体为粗体。原代码较为冗长且不直观,修改后代码更加简洁明了。
  • 一致性提升
    • 如果项目中其他地方都使用 Font.BoldFont.Normal 等标准写法,这次修改消除了不一致性,有利于代码维护。

3. 代码性能审查

  • 影响极小/无影响
    • 这属于属性值的赋值操作,无论是访问 Font.BoldFont.Bold 还是 Font.Bold,在运行时的性能开销几乎可以忽略不计。性能主要取决于 LauncherController.adjustFontWeight 函数内部的逻辑。

4. 代码安全审查

  • 稳定性提升
    • 如果 Font.BoldFont 在旧代码中不是一个有效的枚举对象,在某些 QML 引擎版本或严格模式下可能会导致运行时警告或错误。使用标准的 Font.Bold 保证了跨引擎和跨版本的兼容性与稳定性。

总结与建议

这是一次高质量的代码修正。

  • 主要改进:修复了可能的枚举引用错误,采用了 QML 标准的 API 写法。
  • 建议
    • 确认项目中是否还有其他地方使用了类似 Font.BoldFont.XXX 的非标准写法,建议一并查找替换,以保持代码风格统一。
    • 如果 LauncherController.adjustFontWeight 是项目内部封装的函数,建议确保该函数能正确处理 Font.Bold(即整型数值)作为参数。

@18202781743
Copy link
Contributor Author

/forcemerge

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@deepin-bot
Copy link

deepin-bot bot commented Mar 6, 2026

This pr force merged! (status: blocked)

@deepin-bot deepin-bot bot merged commit 91651d7 into linuxdeepin:master Mar 6, 2026
8 checks passed
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