From e05fa13c9df57ff8c9e5ef359a5540068888f385 Mon Sep 17 00:00:00 2001 From: wjyrich Date: Thu, 21 Aug 2025 16:49:57 +0800 Subject: [PATCH] fix: fix dock window shadow animation issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- panels/dock/package/main.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/panels/dock/package/main.qml b/panels/dock/package/main.qml index d3479c315..aeb4e84c8 100644 --- a/panels/dock/package/main.qml +++ b/panels/dock/package/main.qml @@ -59,9 +59,11 @@ Window { D.DWindow.enabled: true D.DWindow.windowRadius: 0 - //TODO:由于windoweffect处理有BUG,导致动画结束后一致保持无阴影,无borderwidth状态。(所以未取消阴影) - //目前在动画结束后还存在阴影残留 + //TODO:由于windoweffect处理有BUG,导致动画结束后一致保持无阴影,无borderwidth状态。 无法恢复到最初的阴影和边框 //D.DWindow.windowEffect: hideShowAnimation.running ? D.PlatformHandle.EffectNoShadow | D.PlatformHandle.EffectNoBorder : 0 + + //目前直接处理shadowColor(透明和默认值的切换)和borderWidth(0和1的切换),来控制阴影和边框 + D.DWindow.shadowColor: hideShowAnimation.running ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,255 * 0.6) D.DWindow.borderWidth: hideShowAnimation.running ? 0 : 1 D.DWindow.enableBlurWindow: Qt.platform.pluginName !== "xcb" D.DWindow.themeType: Panel.colorTheme