Skip to content

fix(dock): correct hovered crystal color for dark mode in AppItemBack…#1662

Open
Ivy233 wants to merge 1 commit into
linuxdeepin:masterfrom
Ivy233:fix/dock-appitem-hover-crystal-color
Open

fix(dock): correct hovered crystal color for dark mode in AppItemBack…#1662
Ivy233 wants to merge 1 commit into
linuxdeepin:masterfrom
Ivy233:fix/dock-appitem-hover-crystal-color

Conversation

@Ivy233

@Ivy233 Ivy233 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

…ground

  1. Changed hovered crystal color from black (0,0,0,0.05) to white (1,1,1,0.1)
  2. Ensures hover effect is visible on dark backgrounds in dark mode

Log: Fix hovered background color in AppItemBackground for dark mode visibility

fix(dock): 修正 AppItemBackground 深色模式下的悬停水晶颜色

  1. 将悬停水晶颜色从黑色 (0,0,0,0.05) 改为白色 (1,1,1,0.1)
  2. 确保深色模式下在深色背景上悬停效果可见

Log: 修复 AppItemBackground 深色模式下的悬停背景颜色可见性问题
PMS: BUG-364205

Summary by Sourcery

Bug Fixes:

  • Fix invisible hover crystal effect in AppItemBackground when used on dark backgrounds in dark mode.

@sourcery-ai

sourcery-ai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts the hovered crystal background color in AppItemBackground to ensure hover visibility in dark mode, particularly on dark backgrounds.

Flow diagram for dark mode hover background color change

flowchart LR
    A[Pointer hovers over app item<br/>in dark mode] --> B[AppItemBackground.hovered]
    B --> C["Set crystal to Qt.rgba(1.0, 1.0, 1.0, 0.1)"]
    C --> D[Visible hover effect<br/>on dark background]
Loading

File-Level Changes

Change Details Files
Update hover crystal color to use a light, semi-transparent white instead of a dark, semi-transparent black so the hover effect is visible in dark mode.
  • Change hovered state crystal color RGBA from (0, 0, 0, 0.05) to (1.0, 1.0, 1.0, 0.1)
  • Keep dark-mode variants (normalDark, hoveredDark, pressed) mapped to the updated hovered style so behavior remains consistent
panels/dock/taskmanager/package/AppItemBackground.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

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

Hey - I've reviewed your changes and they look great!


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.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Ivy233

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

@Ivy233

Ivy233 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

/retest

…ogic in efficient mode

1. Changed hovered crystal color from black (0,0,0,0.05) to white (1,1,1,0.1) for visibility on dark backgrounds
2. Added control.windowCount > 0 check to outsideBorderColor normal/normalDark states
3. Prevents outer border from showing on pinned items without open windows, aligning with backgroundColor and insideBorderColor

Log: Fix hovered color and outer border logic for app item background in efficient mode

fix(dock): 修正高效模式下 AppItemBackground 的悬停颜色和外描边逻辑

1. 将悬停水晶颜色从黑色 (0,0,0,0.05) 改为白色 (1,1,1,0.1),确保深色背景上可见
2. 在 outsideBorderColor normal/normalDark 添加 control.windowCount > 0 判断
3. 防止无窗口驻留图标显示外描边,与 backgroundColor 和 insideBorderColor 保持一致

Log: 修复高效模式下应用图标背景的悬停颜色和外描边逻辑问题
PMS: BUG-364205
@Ivy233 Ivy233 force-pushed the fix/dock-appitem-hover-crystal-color branch from a24e4d2 to e5b23c9 Compare July 10, 2026 08:08
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:100分

■ 【总体评价】

代码修复了Dock任务管理器在无窗口时的边框显示问题和悬停状态的背景色对比度,逻辑清晰且无安全风险
修改精准有效,语法正确且性能优异,无需扣分

■ 【详细分析】

  • 1.语法逻辑(完全正确)✓

hovered状态的颜色值修改符合Qt.rgba规范,outsideBorderColor中增加control.windowCount > 0的条件判断有效防止了无窗口时的多余边框渲染,逻辑严密
潜在问题:无
建议:无需修改

  • 2.代码质量(优秀)✓

代码修改简洁直接,没有冗余代码,变量命名和结构保持了一致性
潜在问题:无
建议:无需修改

  • 3.代码性能(高效)✓

仅增加了一个简单的数值比较判断,避免了无窗口时不必要的颜色绘制,对性能有微小正面提升
潜在问题:无
建议:无需修改

  • 4.代码安全(存在0个安全漏洞)✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次修改仅涉及QML前端UI样式和简单条件判断,无外部输入处理、网络请求或系统调用,不存在安全攻击面

  • 建议:无需修复

■ 【改进建议代码示例】

diff --git a/panels/dock/taskmanager/package/AppItemBackground.qml b/panels/dock/taskmanager/package/AppItemBackground.qml
index 4c388ed06..dbfe39503 100644
--- a/panels/dock/taskmanager/package/AppItemBackground.qml
+++ b/panels/dock/taskmanager/package/AppItemBackground.qml
@@ -75,7 +75,7 @@ AppletItemBackground {
         }
         normalDark: normal
         hovered {
-            crystal: Qt.rgba(0, 0, 0, 0.05)
+            crystal: Qt.rgba(1.0, 1.0, 1.0, 0.1)
         }
         hoveredDark: hovered
         pressed: hovered
@@ -106,14 +106,14 @@ AppletItemBackground {
     }
     outsideBorderColor: Palette {
         normal {
-            crystal: if (displayMode === Dock.Efficient) {
+            crystal: if (displayMode === Dock.Efficient && control.windowCount > 0) {
                     return Qt.rgba(0, 0, 0, 0.1)
             } else {
                     return ("transparent")
             }
         }
         normalDark {
-            crystal: if (displayMode === Dock.Efficient) {
+            crystal: if (displayMode === Dock.Efficient && control.windowCount > 0) {
                     return Qt.rgba(0, 0, 0, 0.05)
             } else {
                     return ("transparent")

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.

2 participants