-
Notifications
You must be signed in to change notification settings - Fork 55
fix: fix dock window shadow animation issue #1226
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 GuideThis PR replaces the unreliable windowEffect-based shadow handling with direct shadowColor and borderWidth bindings tied to the hideShowAnimation state, ensuring transparent shadows during transitions and restoring proper 60% black shadows and borders afterward. Sequence diagram for shadow and border animation during hide/showsequenceDiagram
participant DWindow
participant hideShowAnimation
hideShowAnimation->>DWindow: Start animation (running = true)
DWindow->>DWindow: Set shadowColor to transparent
DWindow->>DWindow: Set borderWidth to 0
hideShowAnimation->>DWindow: End animation (running = false)
DWindow->>DWindow: Set shadowColor to 60% black
DWindow->>DWindow: Set borderWidth to 1
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.
3285eb1 to
7722ff0
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wjyrich, yixinshark 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 |
1. Replaced problematic windowEffect approach with direct shadowColor control 2. Set shadow color to transparent during hideShowAnimation to avoid visual artifacts 3. Maintain proper shadow opacity (60% black) when animation is not running 4. Fixes the bug where window shadows would persist incorrectly after animations fix: 修复任务栏窗口阴影动画问题 1. 用直接的阴影颜色控制替换有问题的 windowEffect 方法 2. 在 hideShowAnimation 期间将阴影颜色设置为透明以避免视觉伪影 3. 在动画未运行时保持正确的阴影不透明度(60%黑色) 4. 修复动画后窗口阴影错误持续存在的问题 Pms: BUG-317241
7722ff0 to
e05fa13
Compare
deepin pr auto review这段代码是关于dock面板窗口效果的实现,我来分析一下代码并提供改进建议: 1. 语法逻辑分析
2. 代码质量问题
3. 性能考虑
4. 安全性考虑
改进建议:
// 在文件顶部定义常量
readonly property real SHADOW_OPACITY: 0.6
readonly color SHADOW_COLOR_DEFAULT: Qt.rgba(0, 0, 0, 255 * SHADOW_OPACITY)
readonly color SHADOW_COLOR_TRANSPARENT: Qt.rgba(0, 0, 0, 0)
// 使用更直观的属性控制
property bool isAnimationRunning: hideShowAnimation.running
D.DWindow.shadowColor: isAnimationRunning ? SHADOW_COLOR_TRANSPARENT : SHADOW_COLOR_DEFAULT
D.DWindow.borderWidth: isAnimationRunning ? 0 : 1
// 在动画状态变化时添加检查
onIsAnimationRunningChanged: {
if (isAnimationRunning && D.DWindow.windowEffect === 0) {
console.warn("Animation is running but window effect is not properly set")
}
}
// TODO: WindowEffect存在BUG,导致动画结束后无法正确恢复阴影和边框
// 当前临时解决方案:手动控制shadowColor和borderWidth
// 计划:在WindowEffect修复后,改回使用windowEffect属性这些改进将使代码更加健壮、可维护,并可能提高性能。同时,更好的错误处理和状态管理将有助于调试和未来的维护工作。 |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
fix: 修复任务栏窗口阴影动画问题
Pms: BUG-317241
Summary by Sourcery
Fix dock panel window shadow animation by replacing the faulty windowEffect approach with direct shadowColor control, hiding the shadow during animations, and restoring proper shadow opacity afterwards.
Bug Fixes: