Skip to content

fix: adjust notification center scrollbar position#1252

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
18202781743:master
Sep 18, 2025
Merged

fix: adjust notification center scrollbar position#1252
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
18202781743:master

Conversation

@18202781743

Copy link
Copy Markdown
Contributor

Fixed scrollbar positioning issue in notification center by:

  1. Removed unused DS style import that was causing conflicts
  2. Added right anchor and rightMargin to properly position the content
    area
  3. Removed explicit width calculation that was causing misalignment
  4. Maintained height calculation based on maxViewHeight and viewHeight

The scrollbar was incorrectly positioned due to hardcoded width
calculations that didn't account for proper layout constraints. By
using anchor-based layout with appropriate margins instead of explicit
width calculations, the scrollbar now positions correctly within the
notification center panel.

Log: Fixed notification center scrollbar positioning issue

Influence:

  1. Open notification center and verify scrollbar appears correctly
    positioned
  2. Test scrolling functionality with multiple notifications
  3. Check that scrollbar visibility toggles properly based on content
    height
  4. Verify layout consistency across different screen sizes
  5. Test notification center opening/closing animations

fix: 调整通知中心滚动条位置

修复通知中心滚动条定位问题:

  1. 移除导致冲突的未使用 DS 样式导入
  2. 添加右侧锚点和右边距以正确定位内容区域
  3. 移除导致错位的显式宽度计算
  4. 保持基于最大视图高度和视图高度的高度计算

由于硬编码的宽度计算未考虑正确的布局约束,导致滚动条定位不正确。通过使用
基于锚点的布局和适当的边距代替显式宽度计算,滚动条现在可以在通知中心面板
中正确定位。

Log: 修复通知中心滚动条定位问题

Influence:

  1. 打开通知中心并验证滚动条正确定位
  2. 使用多个通知测试滚动功能
  3. 检查滚动条可见性是否根据内容高度正确切换
  4. 验证不同屏幕尺寸下的布局一致性
  5. 测试通知中心打开/关闭动画

PMS: BUG-283695

Fixed scrollbar positioning issue in notification center by:
1. Removed unused DS style import that was causing conflicts
2. Added right anchor and rightMargin to properly position the content
area
3. Removed explicit width calculation that was causing misalignment
4. Maintained height calculation based on maxViewHeight and viewHeight

The scrollbar was incorrectly positioned due to hardcoded width
calculations that didn't account for proper layout constraints. By
using anchor-based layout with appropriate margins instead of explicit
width calculations, the scrollbar now positions correctly within the
notification center panel.

Log: Fixed notification center scrollbar positioning issue

Influence:
1. Open notification center and verify scrollbar appears correctly
positioned
2. Test scrolling functionality with multiple notifications
3. Check that scrollbar visibility toggles properly based on content
height
4. Verify layout consistency across different screen sizes
5. Test notification center opening/closing animations

fix: 调整通知中心滚动条位置

修复通知中心滚动条定位问题:
1. 移除导致冲突的未使用 DS 样式导入
2. 添加右侧锚点和右边距以正确定位内容区域
3. 移除导致错位的显式宽度计算
4. 保持基于最大视图高度和视图高度的高度计算

由于硬编码的宽度计算未考虑正确的布局约束,导致滚动条定位不正确。通过使用
基于锚点的布局和适当的边距代替显式宽度计算,滚动条现在可以在通知中心面板
中正确定位。

Log: 修复通知中心滚动条定位问题

Influence:
1. 打开通知中心并验证滚动条正确定位
2. 使用多个通知测试滚动功能
3. 检查滚动条可见性是否根据内容高度正确切换
4. 验证不同屏幕尺寸下的布局一致性
5. 测试通知中心打开/关闭动画

PMS: BUG-283695

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

Sorry @18202781743, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

我对这段代码审查如下:

  1. 语法逻辑:
  • 代码整体语法逻辑正确,移除了不必要的import语句是合理的
  • 布局属性设置正确,新增的right和rightMargin属性有助于确保内容区域正确填充
  1. 代码质量:
  • 移除了未使用的DS模块导入,提高了代码整洁性
  • 简化了宽度计算逻辑,直接使用锚点布局替代了复杂的宽度计算
  • 布局属性的组织更加清晰,将相关的锚点属性放在一起
  1. 代码性能:
  • 使用锚点布局替代了具体的宽度计算,这通常更高效,因为布局引擎会自动处理
  • 移除了不必要的模块导入,略微减少了内存占用和初始化时间
  1. 代码安全:
  • 没有发现明显的安全问题
  • 使用了标准的Qt布局系统,保证了跨平台的一致性

改进建议:

  1. 可以考虑将rightMargin的值提取为常量或样式属性,以提高可维护性
  2. 建议添加注释说明scrollBarPadding的用途,因为这是一个特定的样式值
  3. 可以考虑将topMargin也提取为样式常量,保持一致性
  4. 建议检查NotifyStyle.scrollBarPadding是否在所有情况下都适用,特别是当内容区域需要特殊处理时

改进后的代码可能如下:

anchors {
    left: parent.left
    top: header.bottom
    right: parent.right
    rightMargin: NotifyStyle.scrollBarPadding  // 考虑提取为常量并添加注释
    topMargin: NotifyStyle.contentMarginTop    // 建议提取为样式常量
    bottom: parent.bottom
}

这些改进主要是为了提高代码的可维护性和可读性,同时保持原有的功能完整性。

@deepin-ci-robot

Copy link
Copy Markdown

[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
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Sep 18, 2025

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot deepin-bot Bot merged commit 7ee4a3d into linuxdeepin:master Sep 18, 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