-
Notifications
You must be signed in to change notification settings - Fork 55
fix: adjust dock shadow parameters #1403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts the dock window’s visual shadow parameters to use a lighter, centered, larger-radius shadow while preserving existing hide/show animation behavior and border toggling. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - I've left some high level feedback:
- The new shadowRadius, shadowOffset, and alpha values are hard-coded magic numbers; consider pulling them from a central theme/config or constants file so they can be reused and tuned without touching code.
- Since the dock may be used on various display scales and themes, consider whether the fixed shadowRadius of 40 should be responsive (e.g., tied to DPI or panel height) to avoid overly large/small shadows on different setups.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new shadowRadius, shadowOffset, and alpha values are hard-coded magic numbers; consider pulling them from a central theme/config or constants file so they can be reused and tuned without touching code.
- Since the dock may be used on various display scales and themes, consider whether the fixed shadowRadius of 40 should be responsive (e.g., tied to DPI or panel height) to avoid overly large/small shadows on different setups.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
panels/dock/package/main.qml
Outdated
| //D.DWindow.windowEffect: hideShowAnimation.running ? D.PlatformHandle.EffectNoShadow | D.PlatformHandle.EffectNoBorder : 0 | ||
|
|
||
| // 目前直接处理shadowColor(透明和默认值的切换)和borderWidth(0和1的切换),来控制阴影和边框 | ||
| // 默认阴影透明度是 60%,见: https://github.com/linuxdeepin/qt5platform-plugins/blob/master/xcb/dframewindow.h#L122 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个注释就不再有用了吧
Adjust dock shadow configuration parameters: - Set shadowRadius to 40px for better visual effect - Set shadowOffset to (0, 0) for centered shadow - Set shadowColor alpha to 0.1 for lighter shadow Task: BUG-331251 修复:调整任务栏阴影参数 调整任务栏阴影配置参数: - 设置 shadowRadius 为 40px 以获得更好的视觉效果 - 设置 shadowOffset 为 (0, 0) 使阴影居中 - 设置 shadowColor 透明度为 0.1 使阴影更轻 任务:BUG-331251
7b9ab05 to
abe92eb
Compare
deepin pr auto review这段代码主要涉及 QML 中 Dock 面板窗口的阴影和边框属性设置。以下是对该 1. 语法逻辑审查
2. 代码质量审查
3. 代码性能审查
4. 代码安全审查
总结与建议修改后的代码基于以上分析,建议对代码进行如下优化,以提高可读性、可维护性和性能: Window {
// ... 其他属性 ...
// 定义阴影配置,集中管理,避免魔法数字
readonly property color shadowColorTransparent: Qt.rgba(0, 0, 0, 0)
readonly property color shadowColorNormal: Qt.rgba(0, 0, 0, 0.1) // 根据设计稿调整的不透明度
readonly property point shadowOffsetNormal: Qt.point(0, 0)
readonly property int shadowRadiusNormal: 40
// 阴影和边框控制
// 动画运行时去除阴影和边框,以保证动画流畅性
D.DWindow.shadowColor: hideShowAnimation.running ? shadowColorTransparent : shadowColorNormal
D.DWindow.shadowOffset: shadowOffsetNormal
D.DWindow.shadowRadius: shadowRadiusNormal
D.DWindow.borderWidth: hideShowAnimation.running ? 0 : 1
// ... 其他属性 ...
}主要改进点:
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, Ivy233 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 |
Adjust dock shadow configuration parameters:
Task: BUG-331251
修复:调整任务栏阴影参数
调整任务栏阴影配置参数:
任务:BUG-331251
Summary by Sourcery
Adjust dock window shadow settings to refine the taskbar’s visual appearance.
Bug Fixes: