fix: adjust notification UI colors and positions#1527
fix: adjust notification UI colors and positions#1527wjyrich merged 1 commit intolinuxdeepin:masterfrom
Conversation
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. 验证不同主题模式下的界面一致性
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts 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 stylingflowchart 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"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
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>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| color: DTK.themeType === ApplicationHelper.DarkType ? | ||
| Qt.rgba(255, 255, 255, 0.7) : | ||
| Qt.rgba(0, 0, 0, 0.75) |
There was a problem hiding this comment.
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.
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Log: Improved notification UI readability and visual alignment
Influence:
fix: 调整通知界面颜色和位置
Log: 改进通知界面可读性和视觉对齐
Influence:
Summary by Sourcery
Improve notification UI readability, contrast, and alignment across light, dark, and crystal themes.
Bug Fixes:
Enhancements: