Skip to content

Commit

Permalink
Add task animations [urgent, active, loading, move]
Browse files Browse the repository at this point in the history
  • Loading branch information
smith committed May 19, 2020
1 parent 14cb93e commit 7b3ed60
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions packages/shell/Components/StartupAnimation.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import QtQuick 2.12
import '../../shared/components'

QObject {
property string objectName: ''
property Item target
property bool running: false

Expand All @@ -14,17 +13,19 @@ QObject {
}

onObjectNameChanged: {
const buffer = store.propertyBuffer
if (objectName) {
const buffer = store.propertyBuffer

const itemName = `${objectName}:startupAnimation`
let animation = buffer[itemName]
const itemName = `${objectName}:startupAnimation`
let animation = buffer[itemName]

if (!animation) {
animation = startupComponent.createObject(root, { objectName })
buffer[itemName] = animation
}
if (!animation) {
animation = startupComponent.createObject(root, { objectName })
buffer[itemName] = animation
}

target.rotation = Qt.binding(() => animation.rotation)
target.rotation = Qt.binding(() => animation.rotation)
}
}

Component {
Expand All @@ -33,8 +34,6 @@ QObject {
QObject {
id: _target

property string objectName

property var start: rotationAnim.start

property real rotation: 0
Expand All @@ -47,7 +46,7 @@ QObject {

RotationAnimation {
target: _target
to: -10
to: -5
easing.type: Easing.OutSine
duration: target.duration
}
Expand All @@ -59,7 +58,7 @@ QObject {
}
RotationAnimation {
target: _target
to: 10
to: 5
easing.type: Easing.OutSine
duration: target.duration
}
Expand Down

0 comments on commit 7b3ed60

Please sign in to comment.