Skip to content

Commit 2704112

Browse files
wjyrichdeepin-bot[bot]
authored andcommitted
fix: prevent animation glitch during task text width changes
1. Fixed animation glitch that occurred when task item text width changed dynamically 2. Added onOptimalSingleTextWidthChanged handler to temporarily disable and re-enable animations 3. Created displacedTransition ID for proper animation reference 4. Used Qt.callLater to ensure smooth transition restoration Log: Fixed taskbar animation glitches when application names change width Influence: 1. Test taskbar behavior when application names change (e.g., language switching) 2. Verify smooth animations when dragging task items 3. Check that text width changes don't cause visual artifacts 4. Test with applications that have varying name lengths 5. Verify task grouping and overflow functionality remains intact fix: 修复任务文本宽度变化时的动画故障 1. 修复了任务项文本宽度动态变化时出现的动画故障 2. 添加了onOptimalSingleTextWidthChanged处理程序,临时禁用并重新启用动画 3. 创建了displacedTransition ID以便正确引用动画 4. 使用Qt.callLater确保平滑恢复过渡效果 Log: 修复了应用程序名称宽度变化时的任务栏动画故障 Influence: 1. 测试应用程序名称变化时的任务栏行为(如语言切换) 2. 验证拖动任务项时的平滑动画效果 3. 检查文本宽度变化不会导致视觉伪影 4. 测试具有不同名称长度的应用程序 5. 验证任务分组和溢出功能保持正常 目前需要修复:拆分后,remove的时候动画显示需要进行修复,目前由于卡图标重叠以及图标间距卡顿问题,主要由于X,Y动画卡主引起,从而去除里相应的remove和add的displace的动画。
1 parent 56460df commit 2704112

2 files changed

Lines changed: 53 additions & 4 deletions

File tree

panels/dock/OverflowContainer.qml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2023-2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: GPL-3.0-or-later
44

@@ -16,6 +16,9 @@ Item {
1616
property alias remove: listView.remove
1717
property alias move: listView.move
1818
property alias displaced: listView.displaced
19+
property alias addDisplaced: listView.addDisplaced
20+
property alias removeDisplaced: listView.removeDisplaced
21+
property alias moveDisplaced: listView.moveDisplaced
1922
ListView {
2023
id: listView
2124
anchors.fill: parent

panels/dock/taskmanager/package/TaskManager.qml

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2023-2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: GPL-3.0-or-later
44

@@ -68,6 +68,14 @@ ContainmentItem {
6868
remainingSpace: taskmanager.remainingSpacesForSplitWindow
6969
font.family: D.DTK.fontManager.t6.family
7070
font.pixelSize: Math.max(10, Math.min(20, Math.round(textCalculator.iconSize * 0.35)))
71+
onOptimalSingleTextWidthChanged: {
72+
appContainer.addDisplaced = null
73+
appContainer.removeDisplaced = null
74+
Qt.callLater(function() {
75+
appContainer.addDisplaced = addDisplacedTransition
76+
appContainer.removeDisplaced = removeDisplacedTransition
77+
})
78+
}
7179
}
7280

7381
OverflowContainer {
@@ -83,7 +91,7 @@ ContainmentItem {
8391
duration: 200
8492
}
8593
}
86-
displaced: Transition {
94+
moveDisplaced: Transition {
8795
NumberAnimation {
8896
properties: "x,y"
8997
easing.type: Easing.OutQuad
@@ -99,7 +107,45 @@ ContainmentItem {
99107
duration: 200
100108
}
101109
}
102-
move: displaced
110+
addDisplaced: Transition {
111+
id: addDisplacedTransition
112+
NumberAnimation {
113+
properties: "x,y"
114+
easing.type: Easing.OutQuad
115+
}
116+
NumberAnimation {
117+
properties: "scale"
118+
from: 0
119+
to: 1
120+
duration: 200
121+
}
122+
NumberAnimation {
123+
properties: "opacity"
124+
from: 0
125+
to: 1
126+
duration: 200
127+
}
128+
}
129+
removeDisplaced: Transition {
130+
id: removeDisplacedTransition
131+
NumberAnimation {
132+
properties: "x,y"
133+
easing.type: Easing.OutQuad
134+
}
135+
NumberAnimation {
136+
properties: "scale"
137+
from: 0
138+
to: 1
139+
duration: 200
140+
}
141+
NumberAnimation {
142+
properties: "opacity"
143+
from: 0
144+
to: 1
145+
duration: 200
146+
}
147+
}
148+
move: moveDisplaced
103149
model: DelegateModel {
104150
id: visualModel
105151
model: taskmanager.Applet.dataModel

0 commit comments

Comments
 (0)