Skip to content

fix: adjust notification UI colors and positions#1527

Merged
wjyrich merged 1 commit intolinuxdeepin:masterfrom
wjyrich:fix-updateUI
Mar 24, 2026
Merged

fix: adjust notification UI colors and positions#1527
wjyrich merged 1 commit intolinuxdeepin:masterfrom
wjyrich:fix-updateUI

Conversation

@wjyrich
Copy link
Contributor

@wjyrich wjyrich commented Mar 24, 2026

  1. Modified DropShadowText.qml to use theme-aware text colors with appropriate opacity for better readability in both light and dark modes
  2. Adjusted close button position in NotifyItemContent.qml by adding 2px offset to fix visual alignment
  3. Increased opacity of crystal theme background colors from 0.5 to 0.9 in both NotifyItemContent.qml and SettingActionButton.qml for better visual contrast

Log: Improved notification UI readability and visual alignment

Influence:

  1. Test notification display in both light and dark themes to ensure text is readable
  2. Verify close button positioning aligns properly with notification items
  3. Check background transparency effects in crystal theme mode
  4. Test overall visual appearance of notification items and settings buttons
  5. Verify UI consistency across different theme modes

fix: 调整通知界面颜色和位置

  1. 修改 DropShadowText.qml 使用主题感知的文本颜色,在亮色和暗色模式下都 提供更好的可读性
  2. 调整 NotifyItemContent.qml 中关闭按钮位置,添加2像素偏移以修复视觉对 齐问题
  3. 将 NotifyItemContent.qml 和 SettingActionButton.qml 中的水晶主题背景 颜色透明度从0.5增加到0.9,以获得更好的视觉对比度

Log: 改进通知界面可读性和视觉对齐

Influence:

  1. 测试亮色和暗色主题下的通知显示,确保文本可读性
  2. 验证关闭按钮位置是否与通知项正确对齐
  3. 检查水晶主题模式下的背景透明度效果
  4. 测试通知项和设置按钮的整体视觉外观
  5. 验证不同主题模式下的界面一致性

Summary by Sourcery

Improve notification UI readability, contrast, and alignment across light, dark, and crystal themes.

Bug Fixes:

  • Correct close button vertical alignment within notification items by adjusting its top margin.

Enhancements:

  • Make notification text color theme-aware with appropriate opacity for better readability in light and dark modes.
  • Increase crystal theme background opacity for notification items and settings action buttons to improve visual contrast and consistency.

1. Modified DropShadowText.qml to use theme-aware text colors with
appropriate opacity for better readability in both light and dark modes
2. Adjusted close button position in NotifyItemContent.qml by adding 2px
offset to fix visual alignment
3. Increased opacity of crystal theme background colors from 0.5 to 0.9
in both NotifyItemContent.qml and SettingActionButton.qml for better
visual contrast

Log: Improved notification UI readability and visual alignment

Influence:
1. Test notification display in both light and dark themes to ensure
text is readable
2. Verify close button positioning aligns properly with notification
items
3. Check background transparency effects in crystal theme mode
4. Test overall visual appearance of notification items and settings
buttons
5. Verify UI consistency across different theme modes

fix: 调整通知界面颜色和位置

1. 修改 DropShadowText.qml 使用主题感知的文本颜色,在亮色和暗色模式下都
提供更好的可读性
2. 调整 NotifyItemContent.qml 中关闭按钮位置,添加2像素偏移以修复视觉对
齐问题
3. 将 NotifyItemContent.qml 和 SettingActionButton.qml 中的水晶主题背景
颜色透明度从0.5增加到0.9,以获得更好的视觉对比度

Log: 改进通知界面可读性和视觉对齐

Influence:
1. 测试亮色和暗色主题下的通知显示,确保文本可读性
2. 验证关闭按钮位置是否与通知项正确对齐
3. 检查水晶主题模式下的背景透明度效果
4. 测试通知项和设置按钮的整体视觉外观
5. 验证不同主题模式下的界面一致性
@sourcery-ai
Copy link

sourcery-ai bot commented Mar 24, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts notification UI text color to be theme-aware, tweaks close button alignment, and increases crystal theme background opacity for better readability and contrast across notification items and settings buttons.

Flow diagram for theme-aware notification styling

flowchart TD
    ThemeChange["Theme change or initial load"] --> DetectTheme
    DetectTheme["Check DTK.themeType"] -->|DarkType| ApplyDarkText
    DetectTheme -->|LightType| ApplyLightText

    ApplyDarkText["Set DropShadowText.color = Qt.rgba(255,255,255,0.7)"] --> ApplyCrystalBackground
    ApplyLightText["Set DropShadowText.color = Qt.rgba(0,0,0,0.75)"] --> ApplyCrystalBackground

    ApplyCrystalBackground["Set crystal background alpha = 0.9 in NotifyItemContent and SettingActionButton"] --> PositionCloseButton
    PositionCloseButton["Set closePlaceHolder.topMargin = -height/2 + 2"] --> RenderNotification["Render notification UI"]
Loading

File-Level Changes

Change Details Files
Make notification text color theme-aware for light/dark modes to improve readability.
  • Replace hardcoded opaque white text color with conditional color based on DTK.themeType.
  • Use semi-transparent near-white text in dark mode and semi-transparent near-black text in light mode.
panels/notification/plugin/DropShadowText.qml
Tweak notification close button vertical position for better visual alignment.
  • Adjust topMargin calculation by adding a 2px offset while keeping existing relative positioning to the parent and control size.
panels/notification/plugin/NotifyItemContent.qml
Increase opacity of crystal theme backgrounds for notifications and settings buttons to improve contrast.
  • Update light crystal background RGBA alpha from 0.5 to 0.9 in normal state.
  • Update dark crystal background RGBA alpha from 0.5 to 0.9 in normalDark state.
  • Apply these changes consistently to notification items and settings action buttons.
panels/notification/plugin/NotifyItemContent.qml
panels/notification/plugin/SettingActionButton.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:

  • In DropShadowText.qml, Qt.rgba expects color components in the 0–1 range, so using 255 for r/g/b (e.g., Qt.rgba(255, 255, 255, 0.7)) will produce invalid values; consider changing these to 1.0 or 255 / 255.0.
  • Instead of branching on DTK.themeType in DropShadowText.qml, consider binding the text color to a theme palette token so that it stays consistent with other components and any future theme changes.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In DropShadowText.qml, Qt.rgba expects color components in the 0–1 range, so using 255 for r/g/b (e.g., Qt.rgba(255, 255, 255, 0.7)) will produce invalid values; consider changing these to 1.0 or 255 / 255.0.
- Instead of branching on DTK.themeType in DropShadowText.qml, consider binding the text color to a theme palette token so that it stays consistent with other components and any future theme changes.

## Individual Comments

### Comment 1
<location path="panels/notification/plugin/DropShadowText.qml" line_range="11-13" />
<code_context>

 Text {
-    color: Qt.rgba(1, 1, 1, 1)
+    color: DTK.themeType === ApplicationHelper.DarkType ?
+    Qt.rgba(255, 255, 255, 0.7) :
+    Qt.rgba(0, 0, 0, 0.75)
 }
</code_context>
<issue_to_address>
**issue (bug_risk):** Use normalized [0,1] channel values with Qt.rgba instead of 0–255.

Qt.rgba takes channel values in the [0,1] range, so using 255 for RGB is incorrect and inconsistent with the existing 240/255.0 pattern. Please update these calls to use normalized values, e.g. `Qt.rgba(1, 1, 1, 0.7)` and `Qt.rgba(0, 0, 0, 0.75)`, to avoid rendering issues and keep usage consistent.
</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.

Comment on lines +11 to +13
color: DTK.themeType === ApplicationHelper.DarkType ?
Qt.rgba(255, 255, 255, 0.7) :
Qt.rgba(0, 0, 0, 0.75)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Use normalized [0,1] channel values with Qt.rgba instead of 0–255.

Qt.rgba takes channel values in the [0,1] range, so using 255 for RGB is incorrect and inconsistent with the existing 240/255.0 pattern. Please update these calls to use normalized values, e.g. Qt.rgba(1, 1, 1, 0.7) and Qt.rgba(0, 0, 0, 0.75), to avoid rendering issues and keep usage consistent.

@wjyrich wjyrich requested a review from 18202781743 March 24, 2026 07:27
@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 wjyrich merged commit 1834298 into linuxdeepin:master Mar 24, 2026
10 of 12 checks passed
@wjyrich wjyrich deleted the fix-updateUI branch March 24, 2026 07:30
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