Skip to content

Commit a6e3959

Browse files
committed
fix: keep dock indicator distance constant when icons scale down
1. 修改指示器边距计算,对所有任务栏位置使用 Math.max() 2. 添加最小距离约束(iconSize/2 - 8)防止指示器过于靠近图标边缘 3. 对所有四个任务栏位置应用修复:顶部、底部、左侧、右侧 4. 确保图标缩小时指示器保持一致的视觉距离 Log: 修复图标缩小时任务栏指示器距离变得过小的问题 Influence: 1. 测试图标正常状态下的任务栏指示器显示 2. 验证悬停图标时指示器距离保持恒定 3. 在所有四个任务栏位置测试(顶部、底部、左侧、右侧) 4. 检查不同图标大小设置下的指示器定位 5. 验证不同屏幕分辨率下的视觉一致性 PMS: BUG-309165
1 parent 53cd1ac commit a6e3959

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

panels/dock/taskmanager/package/AppItem.qml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,25 +161,25 @@ Item {
161161
case Dock.Top: {
162162
windowIndicator.anchors.horizontalCenter = iconContainer.horizontalCenter
163163
windowIndicator.anchors.top = parent.top
164-
windowIndicator.anchors.topMargin = Qt.binding(() => {return (root.height - iconSize) / 2 / 3})
164+
windowIndicator.anchors.topMargin = Qt.binding(() => {return Math.max((root.height - iconSize) / 2 - 8, (root.height - iconSize) / 2 / 3)})
165165
return
166166
}
167167
case Dock.Bottom: {
168168
windowIndicator.anchors.horizontalCenter = iconContainer.horizontalCenter
169169
windowIndicator.anchors.bottom = parent.bottom
170-
windowIndicator.anchors.bottomMargin = Qt.binding(() => {return (root.height - iconSize) / 2 / 3})
170+
windowIndicator.anchors.bottomMargin = Qt.binding(() => {return Math.max((root.height - iconSize) / 2 - 8, (root.height - iconSize) / 2 / 3)})
171171
return
172172
}
173173
case Dock.Left: {
174174
windowIndicator.anchors.verticalCenter = parent.verticalCenter
175175
windowIndicator.anchors.left = parent.left
176-
windowIndicator.anchors.leftMargin = Qt.binding(() => {return (root.width - iconSize) / 2 / 3})
176+
windowIndicator.anchors.leftMargin = Qt.binding(() => {return Math.max((root.width - iconSize) / 2 - 8, (root.width - iconSize) / 2 / 3)})
177177
return
178178
}
179179
case Dock.Right:{
180180
windowIndicator.anchors.verticalCenter = parent.verticalCenter
181181
windowIndicator.anchors.right = parent.right
182-
windowIndicator.anchors.rightMargin = Qt.binding(() => {return (root.width - iconSize) / 2 / 3})
182+
windowIndicator.anchors.rightMargin = Qt.binding(() => {return Math.max((root.width - iconSize) / 2 - 8, (root.width - iconSize) / 2 / 3)})
183183
return
184184
}
185185
}

0 commit comments

Comments
 (0)