Skip to content

Conversation

@18202781743
Copy link
Contributor

@18202781743 18202781743 commented Apr 25, 2025

Add DropShadow for text.

pms: BUG-313195

Summary by Sourcery

Refactor notification header text to use a new custom component with drop shadow effect

Bug Fixes:

  • Add drop shadow to notification header text to improve visual clarity

Enhancements:

  • Create a reusable NotifyHeaderTitleText component with consistent styling and drop shadow

Add DropShadow for text.

pms: BUG-313195
@sourcery-ai
Copy link

sourcery-ai bot commented Apr 25, 2025

Reviewer's Guide by Sourcery

This pull request introduces a new NotifyHeaderTitleText component to provide a consistent look and feel for notification headers by adding a drop shadow effect. The original Text components in NotifyHeader.qml and GroupNotify.qml were replaced with the new component.

Class diagram for NotifyHeaderTitleText

classDiagram
  class NotifyHeaderTitleText {
    property font tFont
    font
    color
    layer.enabled
    layer.effect
  }
  Text <|-- NotifyHeaderTitleText
  NotifyHeaderTitleText -- DropShadow : layer.effect
  note for NotifyHeaderTitleText "Adds a drop shadow to the text"
Loading

File-Level Changes

Change Details Files
Introduced a new NotifyHeaderTitleText component to apply a consistent style and drop shadow to notification headers.
  • Created a new QML component NotifyHeaderTitleText.qml.
  • The new component includes a DropShadow effect for the text.
  • The new component uses a font property tFont to allow for configurable font styles.
  • Replaced the original Text component with the new NotifyHeaderTitleText component in NotifyHeader.qml.
  • Replaced the original Text component with the new NotifyHeaderTitleText component in GroupNotify.qml.
panels/notification/center/NotifyHeader.qml
panels/notification/center/GroupNotify.qml
panels/notification/center/NotifyHeaderTitleText.qml
panels/notification/center/CMakeLists.txt

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

@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. 文件路径和名称

    • CMakeLists.txt 文件中新增的 NotifyHeaderTitleText.qml 文件路径和名称应保持一致,避免混淆。
  2. 代码重复

    • NotifyHeaderTitleText.qml 文件中 font 属性的设置与 DTK.fontManager.t4 相同,可以考虑直接使用 tFont 属性,减少代码重复。
  3. 颜色值

    • NotifyHeaderTitleText.qml 文件中 color 属性设置为 Qt.rgba(1, 1, 1, 1),建议使用常量或定义变量来表示颜色值,以便于维护和修改。
  4. 阴影效果

    • NotifyHeaderTitleText.qml 文件中的 DropShadow 效果参数(如 radius, samples, verticalOffset)可以根据实际需求进行调整,确保阴影效果符合设计要求。
  5. 注释和文档

    • NotifyHeaderTitleText.qml 文件中缺少对 tFont 属性和 DropShadow 效果的注释说明,建议添加以提高代码可读性和可维护性。
  6. 许可证声明

    • 新增的 NotifyHeaderTitleText.qml 文件缺少许可证声明,应确保遵循项目许可证要求。
  7. 导入路径

    • NotifyHeaderTitleText.qml 文件中导入的模块路径应与项目中的其他文件保持一致,避免潜在的路径问题。
  8. 代码风格

    • NotifyHeaderTitleText.qml 文件中的代码缩进和格式应保持一致,以提高代码的可读性。

综上所述,建议对新增的 NotifyHeaderTitleText.qml 文件进行修改,以遵循项目代码规范,并确保代码质量和可维护性。

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 @18202781743 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider renaming tFont to textFont for better readability.
  • It might be beneficial to move the DropShadow effect to a separate file for reusability.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@18202781743
Copy link
Contributor Author

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented Apr 25, 2025

This pr force merged! (status: blocked)

@deepin-bot deepin-bot bot merged commit 680ed58 into linuxdeepin:master Apr 25, 2025
7 of 10 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