@@ -26,6 +26,9 @@ Item {
27 property int animDuration: 10
27 property int animDuration: 10
29+ property bool __useDotAnimation: true
30+ property int __circleModifier: __useDotAnimation ? 1 : 2
29 Connections {
32 Connections {
30 target: model
33 target: model
@@ -41,19 +44,24 @@ Item {
42 function startShowAnimation() {
45 function startShowAnimation() {
43 dotHideAnimTimer.stop()
46 dotHideAnimTimer.stop()
44− circleShrinkAnimTimer.stop()
45 notification.hideAnim.stop()
47 notification.hideAnim.stop()
49+ if (__useDotAnimation) {
47− dotShowAnimTimer.startFromBeginning()
50+ dotShowAnimTimer.startFromBeginning()
48 notification.showAnim.start()
52 notification.showAnim.start()
51 function startHideAnimation() {
55 function startHideAnimation() {
52 dotShowAnimTimer.stop()
56 dotShowAnimTimer.stop()
53− circleGrowAnimTimer.stop()
57+ circleChangeAnimTimer.stop()
54 notification.showAnim.stop()
58 notification.showAnim.stop()
60+ if (__useDotAnimation) {
56− dotHideAnimTimer.startFromBeginning()
61+ dotHideAnimTimer.startFromBeginning()
63+ circleChangeAnimTimer.startFromBeginning()
57 notification.hideAnim.start()
65 notification.hideAnim.start()
@@ -73,22 +81,22 @@ Item {
73 anchors.centerIn: parent
81 anchors.centerIn: parent
76− id: circleGrowAnimTimer
84+ id: circleChangeAnimTimer
78 property int pastCircleCounter
86 property int pastCircleCounter
79 property int presentCircleCounter
87 property int presentCircleCounter
81− interval: animDuration
89+ interval: notification.duration
82 running: false
90 running: false
83 repeat: true
91 repeat: true
84 onTriggered: {
92 onTriggered: {
85 if (pastCircleCounter < pastCircles.count) {
93 if (pastCircleCounter < pastCircles.count) {
86 var nextCircle = pastCircles.itemAt(pastCircleCounter++)
94 var nextCircle = pastCircles.itemAt(pastCircleCounter++)
87− if (nextCircle !== null) nextCircle.pastCircleGrowAnim.start()
95+ if (nextCircle !== null) nextCircle.pastCircleChangeAnim.start()
89 if (pastCircleCounter > pastCircles.count / 2) {
97 if (pastCircleCounter > pastCircles.count / 2) {
90 var nextCircle = presentCircles.itemAt(presentCircleCounter++)
98 var nextCircle = presentCircles.itemAt(presentCircleCounter++)
91− if (nextCircle !== null) nextCircle.presentCircleGrowAnim.start()
99+ if (nextCircle !== null) nextCircle.presentCircleChangeAnim.start()
93 if (presentCircleCounter > infographic.model.currentDay && pastCircleCounter >= pastCircles.count) {
101 if (presentCircleCounter > infographic.model.currentDay && pastCircleCounter >= pastCircles.count) {
@@ -96,39 +104,8 @@ Item {
98 function startFromBeginning() {
106 function startFromBeginning() {
99− circleGrowAnimTimer.pastCircleCounter = 0
107+ circleChangeAnimTimer.pastCircleCounter = 0
100− circleGrowAnimTimer.presentCircleCounter = 0
108+ circleChangeAnimTimer.presentCircleCounter = 0
106− id: circleShrinkAnimTimer
108− property int pastCircleCounter
109− property int presentCircleCounter
111− interval: animDuration
115− if (pastCircleCounter >= 0) {
116− var nextCircle = pastCircles.itemAt(pastCircleCounter--)
117− if (nextCircle !== null) nextCircle.pastCircleShrinkAnim.start()
119− if (pastCircleCounter < pastCircles.count / 2) {
120− var nextCircle = presentCircles.itemAt(presentCircleCounter--)
121− if (nextCircle !== null) nextCircle.presentCircleShrinkAnim.start()
123− if (presentCircleCounter < 0) {
125− infographic.model.readyForDataChange()
129− function startFromBeginning() {
130− pastCircleCounter = pastCircles.count - 1
131− presentCircleCounter = model.currentDay
@@ -139,8 +116,7 @@ Item {
139 model: infographic.model.secondMonth
116 model: infographic.model.secondMonth
141 delegate: ObjectPositioner {
118 delegate: ObjectPositioner {
142− property alias pastCircleGrowAnim: pastCircleGrowAnim
119+ property alias pastCircleChangeAnim: pastCircleChangeAnim
143− property alias pastCircleShrinkAnim: pastCircleShrinkAnim
145 index: model.index
121 index: model.index
146 count: pastCircles.count
122 count: pastCircles.count
@@ -160,52 +136,33 @@ Item {
160 opacity: 0.0
136 opacity: 0.0
161 scale: 0.0
137 scale: 0.0
162 visible: modelData !== undefined
138 visible: modelData !== undefined
163− color: Gradient.threeColorByIndex(index, count, infographic.model.secondColor)
139+ color: "transparent"
165 SequentialAnimation {
141 SequentialAnimation {
166− id: pastCircleGrowAnim
142+ id: pastCircleChangeAnim
169 ParallelAnimation {
145 ParallelAnimation {
170 PropertyAnimation {
146 PropertyAnimation {
171 target: pastCircle
147 target: pastCircle
172 property: "opacity"
148 property: "opacity"
174 to: pastCircle.circleOpacity
149 to: pastCircle.circleOpacity
175 easing.type: Easing.OutCurve
150 easing.type: Easing.OutCurve
176− duration: circleGrowAnimTimer.interval * 4
151+ duration: circleChangeAnimTimer.interval * __circleModifier
178 PropertyAnimation {
153 PropertyAnimation {
179 target: pastCircle
154 target: pastCircle
180 property: "scale"
155 property: "scale"
182 to: modelData
156 to: modelData
183 easing.type: Easing.OutCurve
157 easing.type: Easing.OutCurve
184− duration: circleGrowAnimTimer.interval * 4
158+ duration: circleChangeAnimTimer.interval * __circleModifier
189− SequentialAnimation {
190− id: pastCircleShrinkAnim
197− from: pastCircle.circleOpacity
199− easing.type: Easing.OutCurve
200− duration: circleShrinkAnimTimer.interval * 4
202− PropertyAnimation {
160+ ColorAnimation {
203 target: pastCircle
161 target: pastCircle
204− property: "scale"
162+ property: "color"
205− from: modelData
163+ to: Gradient.threeColorByIndex(index, count, infographic.model.secondColor)
207 easing.type: Easing.OutCurve
164 easing.type: Easing.OutCurve
208− duration: circleShrinkAnimTimer.interval * 4
165+ duration: circleChangeAnimTimer.interval * __circleModifier
@@ -219,8 +176,7 @@ Item {
219 model: infographic.model.firstMonth
176 model: infographic.model.firstMonth
221 delegate: ObjectPositioner {
178 delegate: ObjectPositioner {
222− property alias presentCircleGrowAnim: presentCircleGrowAnim
179+ property alias presentCircleChangeAnim: presentCircleChangeAnim
223− property alias presentCircleShrinkAnim: presentCircleShrinkAnim
225 index: model.index
181 index: model.index
226 count: presentCircles.count
182 count: presentCircles.count
@@ -240,10 +196,10 @@ Item {
240 opacity: 0.0
196 opacity: 0.0
241 scale: 0.0
197 scale: 0.0
242 visible: modelData !== undefined
198 visible: modelData !== undefined
243− color: Gradient.threeColorByIndex(index, infographic.model.currentDay, infographic.model.firstColor)
199+ color: "transparent"
245 SequentialAnimation {
201 SequentialAnimation {
246− id: presentCircleGrowAnim
202+ id: presentCircleChangeAnim
@@ -253,36 +209,21 @@ Item {
253 property: "opacity"
209 property: "opacity"
254 to: presentCircle.circleOpacity
210 to: presentCircle.circleOpacity
255 easing.type: Easing.OutCurve
211 easing.type: Easing.OutCurve
256− duration: circleGrowAnimTimer.interval * 4
212+ duration: circleChangeAnimTimer.interval * __circleModifier
258 PropertyAnimation {
214 PropertyAnimation {
259 target: presentCircle
215 target: presentCircle
260 property: "scale"
216 property: "scale"
261 to: modelData
217 to: modelData
262 easing.type: Easing.OutCurve
218 easing.type: Easing.OutCurve
263− duration: circleGrowAnimTimer.interval * 4
219+ duration: circleChangeAnimTimer.interval * __circleModifier
265− }
221+ ColorAnimation {
268− SequentialAnimation {
269− id: presentCircleShrinkAnim
274 target: presentCircle
222 target: presentCircle
275− property: "opacity"
223+ property: "color"
276− to: 0.0
224+ to: Gradient.threeColorByIndex(index, infographic.model.currentDay, infographic.model.firstColor)
277 easing.type: Easing.OutCurve
225 easing.type: Easing.OutCurve
278− duration: circleShrinkAnimTimer.interval * 4
226+ duration: circleChangeAnimTimer.interval * __circleModifier
281− target: presentCircle
284− easing.type: Easing.OutCurve
285− duration: circleShrinkAnimTimer.interval * 4
@@ -313,7 +254,7 @@ Item {
315 if (dotCounter == Math.round(dots.count / 2)) {
256 if (dotCounter == Math.round(dots.count / 2)) {
316− circleGrowAnimTimer.startFromBeginning()
257+ circleChangeAnimTimer.startFromBeginning()
@@ -340,8 +281,8 @@ Item {
343− if (dotCounter == Math.round(dots.count / 2)) {
284+ if (dotCounter == 0) {
344− circleShrinkAnimTimer.startFromBeginning()
285+ infographic.model.readyForDataChange()
@@ -413,6 +354,7 @@ Item {
413 property alias showAnim: increaseOpacity
354 property alias showAnim: increaseOpacity
415 property real baseOpacity: 0.6
356 property real baseOpacity: 0.6
357+ property real duration: dotShowAnimTimer.interval * 5
417 height: 0.7 * backgroundCircle.width
359 height: 0.7 * backgroundCircle.width
418 width: notification.height
360 width: notification.height
@@ -432,7 +374,7 @@ Item {
432 property: "opacity"
374 property: "opacity"
433 from: 0.0
375 from: 0.0
434 to: notification.baseOpacity
376 to: notification.baseOpacity
435− duration: dotShowAnimTimer.interval * dots.count * 5
377+ duration: notification.duration * dots.count
438 PropertyAnimation {
380 PropertyAnimation {
@@ -442,7 +384,8 @@ Item {
442 property: "opacity"
384 property: "opacity"
443 from: notification.baseOpacity
385 from: notification.baseOpacity
445− duration: dotShowAnimTimer.interval * dots.count * 5
387+ duration: notification.duration * dots.count
388+ onStopped: if (!__useDotAnimation) infographic.model.readyForDataChange()
@@ -453,9 +396,10 @@ Item {
453 onDoubleClicked: {
396 onDoubleClicked: {
454 if (!dotHideAnimTimer.running &&
397 if (!dotHideAnimTimer.running &&
455 !dotShowAnimTimer.running &&
398 !dotShowAnimTimer.running &&
456− !circleShrinkAnimTimer.running &&
399+ !circleChangeAnimTimer.running) {
457− !circleGrowAnimTimer.running)
400+ __useDotAnimation = false
458 infographic.model.nextDataSource()
401 infographic.model.nextDataSource()
461 onClicked: mouse.accepted = false
405 onClicked: mouse.accepted = false