Skip to content

Commit b5dc4b4

Browse files
committed
fix: drop BoxShadow for Attention animation
Remove it because of consuming performance. pms: BUG-365879
1 parent b1b6f8b commit b5dc4b4

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

panels/dock/taskmanager/package/AppItem.qml

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,14 @@ Item {
196196

197197
// TODO: value can set during debugPanel
198198
Loader {
199+
id: aniamtionRoot
200+
function blendColorAlpha(fallback) {
201+
var appearance = DS.applet("org.deepin.ds.dde-appearance")
202+
if (!appearance || appearance.opacity < 0)
203+
return fallback
204+
return appearance.opacity
205+
}
206+
property real blendOpacity: blendColorAlpha(D.DTK.themeType === D.ApplicationHelper.DarkType ? 0.25 : 1.0)
199207
anchors.fill: icon
200208
z: -1
201209
active: root.attention && !Panel.rootObject.isDragging
@@ -212,14 +220,7 @@ Item {
212220
color: Qt.rgba(1, 1, 1, 0.1)
213221

214222
anchors.centerIn: parent
215-
opacity: Math.min(3 - width / originSize, blendColorAlpha(D.DTK.themeType === D.ApplicationHelper.DarkType ? 0.25 : 1.0))
216-
217-
function blendColorAlpha(fallback) {
218-
var appearance = DS.applet("org.deepin.ds.dde-appearance")
219-
if (!appearance || appearance.opacity < 0 || appearance.opacity > fallback || appearance.opacity < fallback)
220-
return fallback
221-
return appearance.opacity
222-
}
223+
opacity: Math.min(3 - width / originSize, aniamtionRoot.blendOpacity)
223224

224225
SequentialAnimation {
225226
running: true
@@ -244,19 +245,20 @@ Item {
244245
NumberAnimation { target: rect; property: "width"; from: originSize * (index + 1); to: originSize * (index + 2); duration: 1200 }
245246
ColorAnimation { target: rect; property: "color"; from: Qt.rgba(1, 1, 1, 0.4); to: Qt.rgba(1, 1, 1, 0.1); duration: 1200 }
246247
}
247-
}
248-
249-
D.BoxShadow {
250-
visible: rect.visible
251-
anchors.fill: rect
252-
z: -2
253-
shadowBlur: 20
254-
shadowColor : Qt.rgba(0, 0, 0, 0.05)
255-
shadowOffsetX : 0
256-
shadowOffsetY : 0
257-
cornerRadius: rect.radius
258-
hollow: true
259-
}
248+
}
249+
250+
// TODO Remove it because of consuming performance.
251+
// D.BoxShadow {
252+
// visible: rect.visible
253+
// anchors.fill: rect
254+
// z: -2
255+
// shadowBlur: 20
256+
// shadowColor : Qt.rgba(0, 0, 0, 0.05)
257+
// shadowOffsetX : 0
258+
// shadowOffsetY : 0
259+
// cornerRadius: rect.radius
260+
// hollow: true
261+
// }
260262
}
261263
}
262264
}

0 commit comments

Comments
 (0)