From a6e3959bd2ad2ced826d711298d7220a778e423b Mon Sep 17 00:00:00 2001 From: Ivy233 Date: Fri, 19 Dec 2025 13:51:52 +0800 Subject: [PATCH] fix: keep dock indicator distance constant when icons scale down MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修改指示器边距计算,对所有任务栏位置使用 Math.max() 2. 添加最小距离约束(iconSize/2 - 8)防止指示器过于靠近图标边缘 3. 对所有四个任务栏位置应用修复:顶部、底部、左侧、右侧 4. 确保图标缩小时指示器保持一致的视觉距离 Log: 修复图标缩小时任务栏指示器距离变得过小的问题 Influence: 1. 测试图标正常状态下的任务栏指示器显示 2. 验证悬停图标时指示器距离保持恒定 3. 在所有四个任务栏位置测试(顶部、底部、左侧、右侧) 4. 检查不同图标大小设置下的指示器定位 5. 验证不同屏幕分辨率下的视觉一致性 PMS: BUG-309165 --- panels/dock/taskmanager/package/AppItem.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panels/dock/taskmanager/package/AppItem.qml b/panels/dock/taskmanager/package/AppItem.qml index d12b75faf..a324bf438 100644 --- a/panels/dock/taskmanager/package/AppItem.qml +++ b/panels/dock/taskmanager/package/AppItem.qml @@ -161,25 +161,25 @@ Item { case Dock.Top: { windowIndicator.anchors.horizontalCenter = iconContainer.horizontalCenter windowIndicator.anchors.top = parent.top - windowIndicator.anchors.topMargin = Qt.binding(() => {return (root.height - iconSize) / 2 / 3}) + windowIndicator.anchors.topMargin = Qt.binding(() => {return Math.max((root.height - iconSize) / 2 - 8, (root.height - iconSize) / 2 / 3)}) return } case Dock.Bottom: { windowIndicator.anchors.horizontalCenter = iconContainer.horizontalCenter windowIndicator.anchors.bottom = parent.bottom - windowIndicator.anchors.bottomMargin = Qt.binding(() => {return (root.height - iconSize) / 2 / 3}) + windowIndicator.anchors.bottomMargin = Qt.binding(() => {return Math.max((root.height - iconSize) / 2 - 8, (root.height - iconSize) / 2 / 3)}) return } case Dock.Left: { windowIndicator.anchors.verticalCenter = parent.verticalCenter windowIndicator.anchors.left = parent.left - windowIndicator.anchors.leftMargin = Qt.binding(() => {return (root.width - iconSize) / 2 / 3}) + windowIndicator.anchors.leftMargin = Qt.binding(() => {return Math.max((root.width - iconSize) / 2 - 8, (root.width - iconSize) / 2 / 3)}) return } case Dock.Right:{ windowIndicator.anchors.verticalCenter = parent.verticalCenter windowIndicator.anchors.right = parent.right - windowIndicator.anchors.rightMargin = Qt.binding(() => {return (root.width - iconSize) / 2 / 3}) + windowIndicator.anchors.rightMargin = Qt.binding(() => {return Math.max((root.width - iconSize) / 2 - 8, (root.width - iconSize) / 2 / 3)}) return } }