From ff973df6b0b4cbd7f55cd16cf6458b8092f14cfe Mon Sep 17 00:00:00 2001 From: Ivy233 Date: Wed, 7 Oct 2026 21:42:53 +0800 Subject: [PATCH] fix: add common palette fallback for dock app backgrounds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AppItemBackground overrides the base AppletItemBackground palettes with crystal-only definitions, dropping the base's common fallback. While the inherited ColorSelector family is still CommonColor (for example during dock item creation), getColor() cannot resolve the crystal-only entries, and reads of backgroundColor, insideBorderColor, outsideBorderColor and the active* variants log "ColorSelector: The ... is an invalid color". Add common transparent fallbacks to the normal group of the overridden palettes, matching AppletItemBackground. The crystal rendering used by the dock is unchanged. dock AppItemBackground 颜色告警修复: AppItemBackground 覆盖 AppletItemBackground 的 palette 时只定义了 crystal 颜色族,丢掉了基类的 common 兜底。当继承的 ColorSelector family 仍为 CommonColor(例如 dock item 创建期间)时,getColor() 无法 解析仅含 crystal 的条目,读取 backgroundColor、insideBorderColor、 outsideBorderColor 及 active* 系列时会打印 "ColorSelector: ... is an invalid color"。现在为各覆盖 palette 的 normal 组补充 common 透明兜底,与 AppletItemBackground 保持一致; dock 正常的 crystal 渲染不变。 PMS: TASK-394335 --- panels/dock/taskmanager/package/AppItemBackground.qml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/panels/dock/taskmanager/package/AppItemBackground.qml b/panels/dock/taskmanager/package/AppItemBackground.qml index 740e4bea7..693af9554 100644 --- a/panels/dock/taskmanager/package/AppItemBackground.qml +++ b/panels/dock/taskmanager/package/AppItemBackground.qml @@ -15,6 +15,7 @@ AppletItemBackground { property int displayMode: Dock.Efficient property Palette minDockEffectActive: Palette { normal { + common: ("transparent") crystal: Qt.rgba(1.0, 1.0, 1.0, 0.8) } normalDark { @@ -29,6 +30,7 @@ AppletItemBackground { } property Palette normalDockEffectActive: Palette { normal { + common: ("transparent") crystal: ("transparent") } normalDark: normal @@ -45,6 +47,7 @@ AppletItemBackground { } backgroundColor: Palette { normal { + common: ("transparent") crystal: if (displayMode === Dock.Efficient && control.windowCount > 0) { return Qt.rgba(1.0, 1.0, 1.0, 0.35) } else { @@ -74,6 +77,7 @@ AppletItemBackground { activeBackgroundColor: displayMode === Dock.Efficient ? minDockEffectActive : normalDockEffectActive insideBorderColor: Palette { normal { + common: ("transparent") crystal: if (displayMode === Dock.Efficient && control.windowCount > 0) { return Qt.rgba(1.0, 1.0, 1.0, 0.05) } else { @@ -91,6 +95,7 @@ AppletItemBackground { activeInsideBorderColor: Palette { normal { + common: ("transparent") crystal: if (displayMode === Dock.Efficient) { return Qt.rgba(0, 0, 0, 0.1) } else { @@ -113,6 +118,7 @@ AppletItemBackground { } outsideBorderColor: Palette { normal { + common: ("transparent") crystal: if (displayMode === Dock.Efficient && control.windowCount > 0) { return Qt.rgba(0, 0, 0, 0.1) } else { @@ -139,6 +145,7 @@ AppletItemBackground { } activeOutsideBorderColor: Palette { normal { + common: ("transparent") crystal: if (displayMode === Dock.Efficient) { return Qt.rgba(0, 0, 0, 0.1) } else {