Skip to content

Conversation

@BLumia
Copy link
Member

@BLumia BLumia commented Nov 18, 2025

由于对 Qt.rgba() 的误用导致阴影过硬,任务栏在下方时由于阴影方向是右下所以不明显,在左/上/右时很显著.

此处对误用进行修正,使用默认阴影透明度(60%).

Summary by Sourcery

Bug Fixes:

  • Use proper alpha parameter in Qt.rgba for D.DWindow.shadowColor instead of multiplying 255 by 0.6

由于对 Qt.rgba() 的误用导致阴影过硬,任务栏在下方时由于阴影方向是右下
所以不明显,在左/上/右时很显著.

此处对误用进行修正,使用默认阴影透明度(60%).

PMS: BUG-331251, BUG-339199
Log:
@BLumia BLumia requested a review from wjyrich November 18, 2025 06:19
@sourcery-ai
Copy link

sourcery-ai bot commented Nov 18, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Corrects the shadow color assignment by using the proper normalized alpha value for Qt.rgba, restoring the intended 60% opacity and improving comment context.

Class diagram for updated DWindow shadowColor assignment

classDiagram
    class Window {
    }
    class D_DWindow {
        shadowColor
        borderWidth
        enableBlurWindow
        themeType
        shadowColor = hideShowAnimation.running ? Qt.rgba(0, 0, 0, 0) : Qt.rgba(0, 0, 0, 0.6)
        borderWidth = hideShowAnimation.running ? 0 : 1
    }
    Window --> D_DWindow: uses
    class hideShowAnimation {
        running
    }
    Window --> hideShowAnimation: uses
Loading

File-Level Changes

Change Details Files
Fix incorrect usage of Qt.rgba for shadow opacity
  • Replaced Qt.rgba(0,0,0,255 * 0.6) with Qt.rgba(0, 0, 0, 0.6)
  • Updated code comment to reference the default 60% shadow opacity and added a link to the source
panels/dock/package/main.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

@deepin-ci-robot
Copy link

deepin pr auto review

我来对这段代码变更进行审查:

  1. 语法逻辑:
  • 代码语法正确,没有语法错误
  • 逻辑清晰,通过动画状态控制阴影和边框的显示/隐藏
  1. 代码质量改进建议:
  • 注释格式规范化:在"目前"前增加了空格,使注释更规范
  • 添加了有价值的参考链接,便于理解默认阴影透明度的来源
  • 代码格式优化:在rgba函数参数之间增加了空格,提高可读性
  1. 代码性能:
  • 性能方面没有明显问题,使用条件运算符进行简单的状态切换是高效的
  • 使用Qt.rgba而不是硬编码的255 * 0.6更直观且性能相当
  1. 代码安全:
  • 没有安全相关的问题
  • 代码处理的是UI相关的视觉效果,不涉及敏感操作

总体评价:
这是一个很好的代码改进,主要提升了代码的可读性和可维护性:

  1. 注释更规范,添加了有价值的参考信息
  2. 代码格式更统一,提高了可读性
  3. 将255 * 0.6改为0.6更直观,且不影响性能

建议保持这个改动,它提高了代码质量而不影响功能。

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 there - 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

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BLumia, 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

@BLumia BLumia merged commit 499d7f8 into linuxdeepin:master Nov 18, 2025
8 of 11 checks passed
@BLumia BLumia deleted the pms-339199-331251 branch November 18, 2025 06:35
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