@@ -165,7 +165,14 @@ Item {
165165 name: root .iconName
166166 sourceSize: Qt .size (Dock .MAX_DOCK_TASKMANAGER_ICON_SIZE , Dock .MAX_DOCK_TASKMANAGER_ICON_SIZE )
167167 anchors .centerIn : parent
168- scale: Panel .rootObject .isDragging ? iconScale : iconScale
168+ scale: iconScale
169+ BeatAnimation {
170+ id: beatAnimation
171+ target: icon
172+ baseScale: iconScale
173+ loops: Animation .Infinite
174+ running: root .attention
175+ }
169176
170177 LaunchAnimation {
171178 id: launchAnimation
@@ -197,68 +204,20 @@ Item {
197204 loops: 1
198205 running: false
199206 }
200- }
201-
202- // TODO: value can set during debugPanel
203- Repeater {
204- model: 5
205- Rectangle {
206- id: rect
207- required property int index
208- property var originSize: Dock .MAX_DOCK_TASKMANAGER_ICON_SIZE * 1.2 * iconScale
209-
210- visible: root .attention && ! Panel .rootObject .isDragging
211- width: originSize * (index - 1 )
212- height: width
213- radius: width / 2
214- color: Qt .rgba (1 , 1 , 1 , 0.1 )
215-
216- anchors .centerIn : icon
217- z: - 1
218- opacity: Math .min (3 - width / originSize, blendColorAlpha (D .DTK .themeType === D .ApplicationHelper .DarkType ? 0.25 : 1.0 ))
219-
220- function blendColorAlpha (fallback ) {
221- var appearance = DS .applet (" org.deepin.ds.dde-appearance" )
222- if (! appearance || appearance .opacity < 0 || appearance .opacity > fallback || appearance .opacity < fallback)
223- return fallback
224- return appearance .opacity
225- }
226-
227- SequentialAnimation {
228- running: root .attention && ! Panel .rootObject .isDragging
229- loops: Animation .Infinite
230207
231- // 弹出
232- ParallelAnimation {
233- NumberAnimation { target: rect; property: " width" ; from: Math .max (originSize * (index - 1 ), 0 ); to: originSize * (index); duration: 1200 }
234- ColorAnimation { target: rect; property: " color" ; from: Qt .rgba (1 , 1 , 1 , 0.4 ); to: Qt .rgba (1 , 1 , 1 , 0.1 ); duration: 1200 }
235- NumberAnimation { target: icon; property: " scale" ; from: iconScale; to: iconScale * 1.15 ; duration: 1200 ; easing .type : Easing .OutElastic ; easing .amplitude : 1 ; easing .period : 0.2 }
208+ Connections {
209+ target: Panel .rootObject
210+ function onPressedAndDragging (isDragging ) {
211+ if (isDragging) {
212+ beatAnimation .stop ()
213+ icon .scale = Qt .binding (function () {
214+ return root .iconScale
215+ })
216+ } else {
217+ beatAnimation .running = Qt .binding (function () {
218+ return root .attention
219+ })
236220 }
237-
238- // 收缩
239- ParallelAnimation {
240- NumberAnimation { target: rect; property: " width" ; from: originSize * (index); to: originSize * (index + 1 ); duration: 1200 }
241- ColorAnimation { target: rect; property: " color" ; from: Qt .rgba (1 , 1 , 1 , 0.4 ); to: Qt .rgba (1 , 1 , 1 , 0.1 ); duration: 1200 }
242- NumberAnimation { target: icon; property: " scale" ; from: iconScale * 1.15 ; to: iconScale; duration: 1200 ; easing .type : Easing .OutElastic ; easing .amplitude : 1 ; easing .period : 0.2 }
243- }
244-
245- // 停顿
246- ParallelAnimation {
247- NumberAnimation { target: rect; property: " width" ; from: originSize * (index + 1 ); to: originSize * (index + 2 ); duration: 1200 }
248- ColorAnimation { target: rect; property: " color" ; from: Qt .rgba (1 , 1 , 1 , 0.4 ); to: Qt .rgba (1 , 1 , 1 , 0.1 ); duration: 1200 }
249- }
250- }
251-
252- D .BoxShadow {
253- visible: rect .visible
254- anchors .fill : rect
255- z: - 2
256- shadowBlur: 20
257- shadowColor : Qt .rgba (0 , 0 , 0 , 0.05 )
258- shadowOffsetX : 0
259- shadowOffsetY : 0
260- cornerRadius: rect .radius
261- hollow: true
262221 }
263222 }
264223 }
0 commit comments