Skip to content

feat: adjust notification center UI styling and layout#1522

Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
wjyrich:feat-updateNotifyUI
Mar 23, 2026
Merged

feat: adjust notification center UI styling and layout#1522
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
wjyrich:feat-updateNotifyUI

Conversation

@wjyrich
Copy link
Contributor

@wjyrich wjyrich commented Mar 23, 2026

  1. Changed crystal theme background color from pure white to light gray (240/255) for better visual comfort
  2. Added text color handling for notification header using DStyle control selectColor
  3. Reduced content padding from 20 to 10 and adjusted window margins for tighter layout
  4. Removed left margin from content area and right margin from header
  5. Updated blendColor function to use local blendColorAlpha instead of dock.blendColorAlpha
  6. Modified blur background colors and opacity values for better visual integration
  7. Added clipItems property to OverlapIndicator to control clipping behavior
  8. Adjusted close button position in NotifyItemContent (rightMargin: -width/2 + 6)
  9. Changed gradient background opacity from 1.0 to 0.5 for crystal theme
  10. Reduced leftMargin in NotifyStyle from 20 to 10
  11. Disabled drop shadow effect on DropShadowText for cleaner appearance

Log: Improved notification center visual design with adjusted colors, spacing, and effects

Influence:

  1. Verify notification center appearance in both light and dark themes
  2. Test overlapping notifications display with new clipping behavior
  3. Check close button positioning in notification items
  4. Verify window margins and padding in different screen configurations
  5. Test notification header text color in various theme conditions
  6. Validate blur effect and transparency in crystal theme
  7. Check notification item background opacity in overlap mode

feat: 调整通知中心UI样式和布局

  1. 将水晶主题背景色从纯白色改为浅灰色(240/255),提升视觉舒适度
  2. 为通知标题添加使用DStyle控制选择颜色的文本颜色处理
  3. 将内容内边距从20减少到10,调整窗口边距实现更紧凑的布局
  4. 移除内容区域的左边距和标题的右边距
  5. 更新混合颜色函数使用本地blendColorAlpha替代dock.blendColorAlpha
  6. 修改模糊背景颜色和透明度值以实现更好的视觉融合
  7. 为重叠指示器添加clipItems属性以控制裁剪行为
  8. 调整通知项内容中关闭按钮的位置(rightMargin: -width/2 + 6)
  9. 将渐变背景透明度从1.0改为0.5(水晶主题)
  10. 将NotifyStyle中的左边距从20减少到10
  11. 禁用DropShadowText的阴影效果以获得更简洁的外观

Log: 优化通知中心视觉设计,调整颜色、间距和效果

Influence:

  1. 验证通知中心在浅色和深色主题下的外观
  2. 测试重叠通知显示与新裁剪行为
  3. 检查通知项中关闭按钮的定位
  4. 验证不同屏幕配置下的窗口边距和内边距
  5. 测试各种主题条件下通知标题文本颜色
  6. 验证水晶主题下的模糊效果和透明度
  7. 检查重叠模式下通知项背景透明度

Summary by Sourcery

Refine the notification center’s visual design for the crystal theme and general layouts to improve readability and spatial compactness.

Enhancements:

  • Tightened notification center layout by reducing padding/margins and adjusting window anchoring and close button positioning.
  • Updated crystal theme background and gradient colors, opacities, and blur blend behavior for better integration with light/dark appearances.
  • Standardized notification header text color using theme-aware styling and removed drop-shadow text effects for a cleaner look.
  • Improved overlapping notification visuals by tuning background colors, per-item opacity, and making clipping behavior configurable via OverlapIndicator.clipItems.
  • Centralized blend opacity handling through a local blendColorAlpha helper instead of relying on dock-level configuration.

@wjyrich wjyrich requested a review from 18202781743 March 23, 2026 08:21
@sourcery-ai
Copy link

sourcery-ai bot commented Mar 23, 2026

Reviewer's Guide

Refines the notification center’s visual design by tightening layout margins/padding, adjusting crystal theme/background and blur colors, tuning notification/overlap backgrounds and opacity, simplifying text rendering, and adding configurability for overlap clipping and theme-aware header text colors.

Class diagram for updated notification center QML components

classDiagram
    class MainWindow {
        +int contentPadding
        +int width
        +int topMargin
        +int rightMargin
        +int bottomMargin
        +double blendColorAlpha(double fallback)
    }

    class StyledBehindWindowBlur {
        +bool valid
        +color blendColor
    }

    class NotifyHeaderTitleText {
        +font tFont
        +color color
    }

    class DropShadowText {
        +color color
    }

    class OverlapIndicator {
        +int count
        +int radius
        +int overlapHeight
        +bool revert
        +bool enableAnimation
        +bool clipItems
    }

    class OverlapNotify {
        +int count
    }

    class NormalNotify {
        +int count
    }

    class NotifyItemBackground {
        +double opacity
        +Palette backgroundColor
    }

    class Palette {
        +PaletteVariant normal
        +PaletteVariant normalDark
    }

    class PaletteVariant {
        +color common
        +color crystal
    }

    class NotifyStyle {
        +int scrollBarPadding
        +int leftMargin
    }

    class contentItem {
        +int width
    }

    DropShadowText <|-- NotifyHeaderTitleText
    MainWindow o-- StyledBehindWindowBlur
    OverlapNotify o-- OverlapIndicator
    OverlapNotify o-- NotifyItemBackground
    NormalNotify o-- NotifyItemBackground
    NotifyItemBackground o-- Palette
    Palette o-- PaletteVariant
    MainWindow o-- NotifyStyle
    NotifyStyle o-- contentItem
Loading

Flow diagram for updated blendColorAlpha selection logic

flowchart TD
    A[Start blendColorAlpha] --> B[Get appearance from DS.applet]
    B --> C{appearance exists and appearance.opacity >= 0}
    C -- Yes --> D[Return appearance.opacity]
    C -- No --> E[Return fallback]
    D --> F[End]
    E --> F[End]
Loading

File-Level Changes

Change Details Files
Tightened window layout and padding and updated blur blend color handling to use local opacity logic.
  • Reduced contentPadding from 20 to 10 and removed NotifyStyle.leftMargin from width calculation so window width is based solely on contentPadding and content width.
  • Adjusted DLayerShellWindow top and bottom margins to add contentPadding, effectively pulling the window closer to screen edges while preserving inner spacing.
  • Introduced a local blendColorAlpha() helper that reads opacity from the appearance applet and uses it for StyledBehindWindowBlur blendColor alpha values instead of dock.blendColorAlpha.
  • Tweaked blur background light/dark colors and opacity for better integration with the crystal theme.
panels/notification/center/package/main.qml
panels/notification/plugin/NotifyStyle.qml
Adjusted notification item visuals (crystal backgrounds, overlap appearance, and close button position).
  • Changed crystal theme notification backgrounds from pure white to light gray (240/255) for both normal and overlapping notifications to reduce contrast.
  • Reduced crystal gradient background opacity from 1.0 to 0.5 for NotifyItemContent and SettingActionButton in both normal and dark variants.
  • Updated overlap background palette and per-item opacity so the top overlapped notification is more prominent (opacity 0.6 vs 0.4).
  • Offset the notification close button by an additional +6 on rightMargin to fine-tune its visual alignment.
panels/notification/center/NormalNotify.qml
panels/notification/center/OverlapNotify.qml
panels/notification/plugin/NotifyItemContent.qml
panels/notification/plugin/SettingActionButton.qml
Improved header/title and overlap indicator behavior for theme-awareness and configurability.
  • Set NotifyHeaderTitleText color via DStyle.Style.control.selectColor to choose appropriate light/dark header text colors with alpha, replacing the previous fixed white-with-shadow approach.
  • Added a clipItems property to OverlapIndicator to allow external control of whether its internal items are clipped, and wired it in OverlapNotify with clipItems: true.
  • Propagated clipItems to internal item clip flags instead of always clipping.
panels/notification/center/NotifyHeaderTitleText.qml
panels/notification/center/OverlapNotify.qml
panels/notification/plugin/OverlapIndicator.qml
Simplified text rendering by disabling DropShadowText’s shadow layer.
  • Commented out layer.enabled and the DropShadow effect configuration in DropShadowText to remove shadow rendering and produce a flatter, cleaner text style.
panels/notification/plugin/DropShadowText.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 found 1 issue, and left some high level feedback:

  • The new blendColorAlpha(fallback) helper directly returns appearance.opacity without any bounds checking; consider clamping this value to a sane range (e.g. 0–1) to avoid surprising results if appearance returns out‑of‑range values.
  • In OverlapIndicator the new clipItems property defaults to false, changing the previous behavior where clip was always true; if only some consumers need unclipped items, it might be safer to default clipItems to true and explicitly disable it where needed.
  • DropShadowText now has the DropShadow layer completely commented out; if the shadow is no longer needed, consider removing the dead code instead of commenting it to keep the component clean and easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new blendColorAlpha(fallback) helper directly returns appearance.opacity without any bounds checking; consider clamping this value to a sane range (e.g. 0–1) to avoid surprising results if appearance returns out‑of‑range values.
- In OverlapIndicator the new clipItems property defaults to false, changing the previous behavior where clip was always true; if only some consumers need unclipped items, it might be safer to default clipItems to true and explicitly disable it where needed.
- DropShadowText now has the DropShadow layer completely commented out; if the shadow is no longer needed, consider removing the dead code instead of commenting it to keep the component clean and easier to maintain.

## Individual Comments

### Comment 1
<location path="panels/notification/center/OverlapNotify.qml" line_range="151" />
<code_context>
                 z: -1
                 count: root.count
                 background: NotifyItemBackground {
+                    opacity: parent && parent.realIndex === 0 ? 0.6 : 0.4
                     backgroundColor: Palette {
                         normal {
</code_context>
<issue_to_address>
**issue (bug_risk):** `parent.realIndex` is likely not the intended source for the index.

Within `NotifyItemBackground`, `parent` is likely the `Loader` (or another wrapper), not the Repeater delegate that owns `realIndex`. That would make `parent.realIndex` `undefined`, so this always evaluates to `0.4` and the first item never gets `0.6` opacity. Consider passing `realIndex` explicitly as a property to `NotifyItemBackground` or referencing it via a specific id in scope instead of relying on `parent.realIndex`.
</issue_to_address>

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.

@wjyrich wjyrich force-pushed the feat-updateNotifyUI branch 2 times, most recently from 6414895 to 00d2079 Compare March 23, 2026 08:36
1. Changed crystal theme background color from pure white to light gray
(240/255) for better visual comfort
2. Added text color handling for notification header using DStyle
control selectColor
3. Reduced content padding from 20 to 10 and adjusted window margins for
tighter layout
4. Removed left margin from content area and right margin from header
5. Updated blendColor function to use local blendColorAlpha instead of
dock.blendColorAlpha
6. Modified blur background colors and opacity values for better visual
integration
7. Added clipItems property to OverlapIndicator to control clipping
behavior
8. Adjusted close button position in NotifyItemContent (rightMargin:
-width/2 + 6)
9. Changed gradient background opacity from 1.0 to 0.5 for crystal theme
10. Reduced leftMargin in NotifyStyle from 20 to 10
11. Disabled drop shadow effect on DropShadowText for cleaner appearance

Log: Improved notification center visual design with adjusted colors,
spacing, and effects

Influence:
1. Verify notification center appearance in both light and dark themes
2. Test overlapping notifications display with new clipping behavior
3. Check close button positioning in notification items
4. Verify window margins and padding in different screen configurations
5. Test notification header text color in various theme conditions
6. Validate blur effect and transparency in crystal theme
7. Check notification item background opacity in overlap mode

feat: 调整通知中心UI样式和布局

1. 将水晶主题背景色从纯白色改为浅灰色(240/255),提升视觉舒适度
2. 为通知标题添加使用DStyle控制选择颜色的文本颜色处理
3. 将内容内边距从20减少到10,调整窗口边距实现更紧凑的布局
4. 移除内容区域的左边距和标题的右边距
5. 更新混合颜色函数使用本地blendColorAlpha替代dock.blendColorAlpha
6. 修改模糊背景颜色和透明度值以实现更好的视觉融合
7. 为重叠指示器添加clipItems属性以控制裁剪行为
8. 调整通知项内容中关闭按钮的位置(rightMargin: -width/2 + 6)
9. 将渐变背景透明度从1.0改为0.5(水晶主题)
10. 将NotifyStyle中的左边距从20减少到10
11. 禁用DropShadowText的阴影效果以获得更简洁的外观

Log: 优化通知中心视觉设计,调整颜色、间距和效果

Influence:
1. 验证通知中心在浅色和深色主题下的外观
2. 测试重叠通知显示与新裁剪行为
3. 检查通知项中关闭按钮的定位
4. 验证不同屏幕配置下的窗口边距和内边距
5. 测试各种主题条件下通知标题文本颜色
6. 验证水晶主题下的模糊效果和透明度
7. 检查重叠模式下通知项背景透明度
@wjyrich wjyrich force-pushed the feat-updateNotifyUI branch from 00d2079 to 7b2ec7c Compare March 23, 2026 09:10
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@wjyrich
Copy link
Contributor Author

wjyrich commented Mar 23, 2026

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented Mar 23, 2026

This pr force merged! (status: behind)

@deepin-bot deepin-bot bot merged commit fe817da into linuxdeepin:master Mar 23, 2026
9 of 12 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