Changeset View
Changeset View
Standalone View
Standalone View
src/activities/penalty/Progress.qml
- This file was added.
1 | import QtQuick 2.0 | ||||
---|---|---|---|---|---|
2 | | ||||
3 | Rectangle { | ||||
4 | id: progress | ||||
5 | property int ratio: 0 | ||||
6 | property ParallelAnimation anim: animation | ||||
7 | opacity: items.progressBarOpacity | ||||
8 | anchors.top: parent.top | ||||
9 | anchors.topMargin: parent.height / parent.implicitHeight * 100 | ||||
10 | width: ratio / 100 * parent.width / parent.implicitWidth * 200 | ||||
11 | height: parent.height / parent.implicitHeight * 20 | ||||
12 | ParallelAnimation { | ||||
13 | id: animation | ||||
14 | onRunningChanged: { | ||||
15 | if (!animation.running) { | ||||
16 | timerBonus.start() | ||||
17 | } | ||||
18 | } | ||||
19 | PropertyAnimation { | ||||
20 | target: progress | ||||
21 | property: "ratio" | ||||
22 | from: 0 | ||||
23 | to: 100 | ||||
24 | duration: items.duration | ||||
25 | } | ||||
26 | PropertyAnimation { | ||||
27 | target: progress | ||||
28 | property: "color" | ||||
29 | from: "#00FF00" | ||||
30 | to: "#FF0000" | ||||
31 | duration: items.duration | ||||
32 | } | ||||
33 | } | ||||
34 | } |