Skip to content

fix: ensure panel tooltips are capitalized#1249

Merged
BLumia merged 1 commit into
linuxdeepin:masterfrom
BLumia:cap-tip
Sep 18, 2025
Merged

fix: ensure panel tooltips are capitalized#1249
BLumia merged 1 commit into
linuxdeepin:masterfrom
BLumia:cap-tip

Conversation

@BLumia

@BLumia BLumia commented Sep 17, 2025

Copy link
Copy Markdown
Member

确保面板的 tooltip 提示逐词首字母大写.

潜在影响:所有 panel tooltip 的文本都会遵循首字母大写的显示方式。目前检查没发现例外,如果有的话就得把这个选项导出成属性,允许各个组件主动设置了。

Summary by Sourcery

Bug Fixes:

  • Ensure panel tooltips display with word-initial capitalization by configuring the font capitalization property

@BLumia BLumia requested a review from 18202781743 September 17, 2025 10:07
@sourcery-ai

sourcery-ai Bot commented Sep 17, 2025

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Restructures the font declaration in PanelToolTip.qml to apply per-word capitalization by converting the font property to an object and specifying the family, pointSize, and capitalization settings.

File-Level Changes

Change Details Files
Convert font assignment to an object and enforce capitalization
  • Replace flat font reference with a font object
  • Copy family and pointSize from DTK.fontManager.t6
  • Add capitalization: Font.Capitalize property
frame/qml/PanelToolTip.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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - 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.

Comment thread frame/qml/PanelToolTip.qml Outdated
确保面板的 tooltip 提示逐词首字母大写.

PMS: BUG-334469
Log:
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

这段代码是关于PanelToolTip.qml中字体设置的修改,我来分析一下这个改动:

  1. 语法逻辑:
  • 原代码直接使用了DTK.fontManager.t6作为字体设置
  • 新代码将字体设置拆分为family、pixelSize和capitalization三个属性
  • 语法上没有问题,但增加了capitalization属性,这是原代码中没有的
  1. 代码质量:
  • 修改后的代码更加明确地指定了字体的各个属性,提高了代码的可读性
  • 但是引入了新的capitalization属性,可能会影响原有的文本显示效果,因为原代码没有这个设置
  1. 代码性能:
  • 这种拆分方式可能会略微增加属性查找的开销
  • 但影响微乎其微,可以忽略不计
  1. 代码安全:
  • 没有明显的安全问题
  • 但需要注意capitalization: Font.Capitalize会将所有文本转换为大写,这可能不是期望的行为

改进建议:

  1. 如果需要保留原有的文本大小写,建议移除capitalization属性
  2. 如果确实需要文本大写转换,建议添加注释说明原因
  3. 考虑将字体设置提取为一个可重用的组件,以提高代码复用性

修改建议如下:

font {
    family: DTK.fontManager.t6.family
    pixelSize: DTK.fontManager.t6.pixelSize
    // 如果确实需要文本大写,请取消下面的注释
    // capitalization: Font.Capitalize
}

或者更好的方式是:

// 如果不需要文本大写转换
font: DTK.fontManager.t6

// 如果需要文本大写转换,建议添加注释说明原因
font {
    family: DTK.fontManager.t6.family
    pixelSize: DTK.fontManager.t6.pixelSize
    // 将所有文本转换为大写显示
    capitalization: Font.Capitalize
}

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@BLumia BLumia merged commit f09556b into linuxdeepin:master Sep 18, 2025
8 of 11 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