Skip to content

Conversation

@18202781743
Copy link
Contributor

@18202781743 18202781743 commented Sep 23, 2025

Fixed notification center window positioning by adding top margin to
match the left/right margins. Previously the window was flush with
the top edge while having side margins, creating inconsistent spacing.
Now the top margin uses the same contentPadding value as the sides for
consistent visual alignment.

Influence:

  1. Verify notification center appears with equal spacing on all sides
  2. Test that window positioning remains correct when contentPadding
    changes
  3. Check that notifications display properly within the adjusted bounds

fix: 调整通知中心窗口位置

修复通知中心窗口位置问题,通过添加顶部边距使其与左右边距保持一致。之前窗
口顶部边缘没有边距而两侧有边距,导致间距不一致。现在顶部边距使用与两侧相
同的contentPadding值,实现一致的视觉对齐。

Influence:

  1. 验证通知中心在所有边距上显示相等的间距
  2. 测试当contentPadding变化时窗口位置保持正确
  3. 检查通知在调整后的边界内正确显示

PMS: BUG-335225

Summary by Sourcery

Bug Fixes:

  • Apply contentPadding as the topMargin on the notification center window to prevent it from being flush with the top edge

Fixed notification center window positioning by adding top margin to
match the left/right margins. Previously the window was flush with
the top edge while having side margins, creating inconsistent spacing.
Now the top margin uses the same contentPadding value as the sides for
consistent visual alignment.

Influence:
1. Verify notification center appears with equal spacing on all sides
2. Test that window positioning remains correct when contentPadding
changes
3. Check that notifications display properly within the adjusted bounds

fix: 调整通知中心窗口位置

修复通知中心窗口位置问题,通过添加顶部边距使其与左右边距保持一致。之前窗
口顶部边缘没有边距而两侧有边距,导致间距不一致。现在顶部边距使用与两侧相
同的contentPadding值,实现一致的视觉对齐。

Influence:
1. 验证通知中心在所有边距上显示相等的间距
2. 测试当contentPadding变化时窗口位置保持正确
3. 检查通知在调整后的边界内正确显示

PMS: BUG-335225
@sourcery-ai
Copy link

sourcery-ai bot commented Sep 23, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR introduces a consistent top margin for the notification center by applying the same contentPadding used for left/right margins, ensuring uniform window positioning and spacing.

File-Level Changes

Change Details Files
Add consistent top margin to notification center window
  • Inserted topMargin property under Window anchors
  • Applied contentPadding value to top margin for visual alignment
panels/notification/center/package/main.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

@deepin-ci-robot
Copy link

deepin pr auto review

我对这段代码审查如下:

  1. 语法逻辑:
  • 代码添加了 topMargin: contentPadding 属性,这是合理的,因为它为内容区域添加了顶部边距,使布局更加一致和美观。
  • 修改后的锚点设置保持了原有的布局结构,只是增加了顶部边距。
  1. 代码质量:
  • 代码风格与原有代码保持一致,使用了相同的缩进和格式。
  • 使用了 contentPadding 常量作为边距值,这是好的实践,因为它保持了整个UI的一致性。
  1. 代码性能:
  • 这个修改不会对性能产生明显影响,因为它只是添加了一个静态的边距值。
  • 在QML中,使用常量作为边距值是高效的,因为它不需要在运行时计算。
  1. 代码安全:
  • 代码没有引入任何安全隐患。
  • 使用已经定义的 contentPadding 常量是安全的,前提是它已经在代码的其他地方正确定义。

改进建议:

  1. 为了提高代码的可维护性,建议添加注释说明为什么需要添加这个顶部边距,特别是在复杂的项目中,这可以帮助其他开发者理解布局的意图。
  2. 如果 contentPadding 是一个可变的值,并且可能在运行时改变,那么考虑是否需要监听它的变化并相应地调整布局。不过从当前代码来看,这似乎是一个常量,所以这个问题不大。
  3. 考虑是否需要在其他方向(如底部)也添加相同的边距,以保持整个通知中心面板的一致性。但这取决于具体的设计需求。

总体而言,这个修改是合理的,它改善了UI的一致性和美观性,同时保持了代码的简洁性和高效性。

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

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

1 similar comment
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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 18202781743 merged commit 4feb8ba into linuxdeepin:master Sep 23, 2025
10 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.

4 participants