Skip to content

feat: add blur background to notification center#1520

Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
18202781743:master
Mar 23, 2026
Merged

feat: add blur background to notification center#1520
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
18202781743:master

Conversation

@18202781743
Copy link
Contributor

@18202781743 18202781743 commented Mar 23, 2026

  1. Enabled window blur effect for notification center main window
  2. Added transparent blur background to individual notification items
  3. Implemented crystal theme support with opacity adjustments for both
    light and dark modes
  4. Enhanced OverlapIndicator with proper background styling and border
    colors
  5. Added StyledBehindWindowBlur component to handle blur effects when
    enabled
  6. Modified notification item backgrounds to support border colors and
    improved visual hierarchy

Log: Notification center now features blur background effects for better
visual integration

Influence:

  1. Test notification center appearance in both light and dark themes
  2. Verify blur effect works correctly when opening notification center
  3. Check individual notification items have proper transparent
    backgrounds
  4. Test overlapping notifications display correctly with new background
    styling
  5. Verify border colors and opacity settings work as expected in
    different themes
  6. Test performance with blur effects enabled, especially with multiple
    notifications

feat: 为通知中心添加模糊背景效果

  1. 为通知中心主窗口启用了窗口模糊效果
  2. 为单个通知项添加了透明模糊背景
  3. 实现了水晶主题支持,包含针对浅色和深色模式的不透明度调整
  4. 增强了重叠指示器的背景样式和边框颜色
  5. 添加了StyledBehindWindowBlur组件以处理启用时的模糊效果
  6. 修改了通知项背景以支持边框颜色并改进了视觉层次

Log: 通知中心现在具有模糊背景效果,提供更好的视觉集成

Influence:

  1. 测试通知中心在浅色和深色主题下的外观
  2. 验证打开通知中心时模糊效果正常工作
  3. 检查单个通知项是否具有正确的透明背景
  4. 测试重叠通知在新的背景样式下正确显示
  5. 验证不同主题下边框颜色和不透明度设置按预期工作
  6. 测试启用模糊效果时的性能,特别是在多个通知的情况下

PMS: BUG-338883

Summary by Sourcery

Enable blurred, theme-aware backgrounds for the notification center window and notifications, improving visual integration and hierarchy.

New Features:

  • Add optional background support to overlap indicators and notification item content via a pluggable background component.
  • Enable window blur and behind-window blend color styling for the notification center main window.
  • Provide crystal theme backgrounds for normal and overlapping notifications with light and dark mode opacity tuning.

Enhancements:

  • Extend NotifyItemBackground to support configurable border colors and apply them to overlapping notifications for clearer separation.

@sourcery-ai
Copy link

sourcery-ai bot commented Mar 23, 2026

Reviewer's Guide

Implements blurred, theme-aware backgrounds for the notification center window and notification items, adds a reusable blur component, and updates overlap/notification visuals to support crystal theme opacity and border colors.

Class diagram for notification blur and background components

classDiagram
    class Window_main {
        +bool DWindow_enabled
        +bool DWindow_enableBlurWindow
        +color color
    }

    class StyledBehindWindowBlur {
        +Item control
        +int cornerRadius
        +color blendColor
        +bool valid
    }

    class NotifyItemBackground {
        +int radius
        +Palette borderColor
        +Palette backgroundColor
    }

    class NotifyItemContent {
        +bool enableDismissed
        +Component clearButton
        +Item clearButtonItem
        +NotifyItemBackground background
    }

    class NormalNotify {
        +NotifyItemBackground background
    }

    class OverlapNotify {
        +NotifyItemBackground background
    }

    class OverlapIndicator {
        +int implicitHeight
        +int implicitWidth
        +int count
        +int radius
        +int overlapHeight
        +bool revert
        +bool enableAnimation
        +Component background
    }

    Window_main --> StyledBehindWindowBlur : uses
    NotifyItemContent *-- NotifyItemBackground : has_background
    NormalNotify *-- NotifyItemBackground : has_background
    OverlapNotify *-- NotifyItemBackground : has_background
    OverlapIndicator --> NotifyItemBackground : background_component
    StyledBehindWindowBlur --> Window_main : decorates_window
Loading

Flow diagram for blur background and theme-aware color selection

graph TD
    A_Open_notification_center["Open notification center window"] --> B_Check_blur_flag["DWindow_enableBlurWindow == true"]

    B_Check_blur_flag -->|true| C_Create_blur_layer["Create StyledBehindWindowBlur"]
    B_Check_blur_flag -->|false| D_No_blur_layer["Use non_blurred_background_colors"]

    C_Create_blur_layer --> E_Check_valid["StyledBehindWindowBlur_valid"]
    E_Check_valid -->|true| F_Select_blurred_blend_color["DStyle_Style_control_selectColor_with_blur_alphas"]
    E_Check_valid -->|false| G_Select_no_blur_color["DStyle_Style_control_selectColor_no_blur_colors"]

    F_Select_blurred_blend_color --> H_Apply_blur_to_window["Apply_blendColor_as_blurred_window_background"]
    G_Select_no_blur_color --> H_Apply_blur_to_window

    H_Apply_blur_to_window --> I_Notify_items_blurred_background["Notify_items_use_NotifyItemBackground_with_crystal_palette"]
    I_Notify_items_blurred_background --> J_Overlap_indicator_background["OverlapIndicator_loads_background_component_with_border_colors"]
Loading

File-Level Changes

Change Details Files
Enable behind-window blur and theme-aware tinted background for the notification center main window.
  • Import DStyle style module to access theme colors and no-blur fallbacks.
  • Enable DWindow features and blur (DWindow.enabled and DWindow.enableBlurWindow).
  • Add StyledBehindWindowBlur overlay with dynamic blendColor based on light/dark theme and whether blur is valid.
panels/notification/center/package/main.qml
Introduce configurable blurred/transparent backgrounds for normal and overlapping notification items, including crystal theme colors.
  • Expose a background alias on NotifyItemContent so callers can provide custom backgrounds.
  • Apply NotifyItemBackground with transparent/crystal-tinted Palette to NormalNotify and OverlapNotify items for light and dark themes.
  • Update OverlapNotify’s OverlapIndicator usage to use a separate NotifyItemBackground instance with distinct background and border colors for crystal theme.
panels/notification/plugin/NotifyItemContent.qml
panels/notification/center/NormalNotify.qml
panels/notification/center/OverlapNotify.qml
Extend NotifyItemBackground to support themeable border colors and wire it into the visual tree.
  • Add a borderColor Palette property to NotifyItemBackground with default transparent value.
  • Bind rectangle border.color to ColorSelector.borderColor so border colors can be themed per mode.
  • Provide hooks in OverlapNotify for borderColor while explicitly disabling inside/outside borders and drop shadow where not desired.
panels/notification/plugin/NotifyItemBackground.qml
panels/notification/center/OverlapNotify.qml
Refactor OverlapIndicator to use a configurable background component and improve overlap layout and animation handling.
  • Add a background Component property on OverlapIndicator that defaults to NotifyItemBackground with zero opacity.
  • Replace direct NotifyItemBackground usage in the delegate with a Loader that instantiates root.background and forwards geometry/overlap properties.
  • Adjust layout metrics (spacing, preferred sizes) and anchoring logic for overlap items, and ensure fade-in animation targets the loaded background item’s opacity.
panels/notification/plugin/OverlapIndicator.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 crystal background palettes for NormalNotify, OverlapNotify, and the OverlapIndicator background repeat similar hard-coded RGBA values; consider centralizing these colors/alpha values (e.g., in a shared theme or constants file) to avoid duplication and make future tweaks easier.
  • In main.qml, you always enable DWindow.enabled and DWindow.enableBlurWindow; if blur is meant to be optional (per your comment about only adding blend color when blur is true), consider wiring these flags to an actual configuration/feature toggle so the window behavior and blur effects can still be disabled when needed.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The crystal background palettes for `NormalNotify`, `OverlapNotify`, and the `OverlapIndicator` background repeat similar hard-coded RGBA values; consider centralizing these colors/alpha values (e.g., in a shared theme or constants file) to avoid duplication and make future tweaks easier.
- In `main.qml`, you always enable `DWindow.enabled` and `DWindow.enableBlurWindow`; if blur is meant to be optional (per your comment about only adding blend color when blur is true), consider wiring these flags to an actual configuration/feature toggle so the window behavior and blur effects can still be disabled when needed.

## Individual Comments

### Comment 1
<location path="panels/notification/plugin/OverlapIndicator.qml" line_range="19-24" />
<code_context>

     implicitHeight: layout.height
     implicitWidth: 360
+    property Component background: NotifyItemBackground {
+                        radius: overlapHeight
+                        opacity: 0
+                    }
+
</code_context>
<issue_to_address>
**suggestion (bug_risk):** `radius` for the background component is now tied to `overlapHeight` while the visual height is based on `root.radius`, which can lead to inconsistent rounding.

With `Loader` using `height: root.radius * 2` and `NotifyItemBackground` using `radius: overlapHeight`, differing values will produce a pill whose corner radius no longer matches its visual height. If the visual radius should still follow `root.radius`, consider basing the background’s `radius` on `root.radius` and using `overlapHeight` only for overlap behavior.

```suggestion
    implicitHeight: layout.height
    implicitWidth: 360
    property Component background: NotifyItemBackground {
                        radius: root.radius
                        opacity: 0
                    }
```
</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.

BLumia
BLumia previously approved these changes Mar 23, 2026
1. Added blur background effect to notification center window using
DWindow.enableBlurWindow and StyledBehindWindowBlur
2. Enabled window radius and disabled system resize/move for better
visual integration
3. Added semi-transparent crystal background to NormalNotify and
OverlapNotify items
4. Enhanced OverlapIndicator with proper background styling and border
colors
5. Extended NotifyItemBackground to support borderColor property for
better visual separation
6. Modified OverlapIndicator layout to use Loader for background
component with proper positioning

Log: Notification center now features blur background with crystal theme
support

Influence:
1. Test notification center appearance with light and dark themes
2. Verify blur effect works correctly when opening notification center
3. Check notification item backgrounds have proper transparency in
crystal theme
4. Test overlapping notification indicators display correctly with new
background styling
5. Verify window cannot be resized or moved by system controls
6. Test notification center follows dock screen correctly
7. Check border colors in OverlapIndicator for both light and dark modes

feat: 为通知中心添加模糊背景效果

1. 使用 DWindow.enableBlurWindow 和 StyledBehindWindowBlur 为通知中心窗
口添加模糊背景效果
2. 启用窗口圆角并禁用系统调整大小/移动功能,以获得更好的视觉集成效果
3. 为 NormalNotify 和 OverlapNotify 项目添加半透明水晶主题背景
4. 增强 OverlapIndicator,添加适当的背景样式和边框颜色
5. 扩展 NotifyItemBackground 以支持 borderColor 属性,实现更好的视觉分离
效果
6. 修改 OverlapIndicator 布局,使用 Loader 加载背景组件并正确定位

Log: 通知中心现在支持模糊背景效果和水晶主题

Influence:
1. 测试通知中心在浅色和深色主题下的外观
2. 验证打开通知中心时模糊效果正常工作
3. 检查通知项目背景在水晶主题下具有适当的透明度
4. 测试重叠通知指示器在新背景样式下正确显示
5. 验证窗口无法通过系统控件调整大小或移动
6. 测试通知中心正确跟随任务栏屏幕
7. 检查 OverlapIndicator 在浅色和深色模式下的边框颜色

PMS: BUG-338883
@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 Mar 23, 2026

This pr force merged! (status: blocked)

@deepin-bot deepin-bot bot merged commit 201f6dc 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.

4 participants