~mterry/+junk/u8.2

« back to all changes in this revision

Viewing changes to qml/Greeter/Infographics.qml

  • Committer: Michael Terry
  • Date: 2014-11-17 14:56:04 UTC
  • mfrom: (1317.1.118 unity8)
  • Revision ID: michael.terry@canonical.com-20141117145604-96dn9p5nwkifq2f4
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
    property int animDuration: 10
28
28
 
29
 
    property bool __useDotAnimation: true
30
 
    property int __circleModifier: __useDotAnimation ? 1 : 2
 
29
    QtObject {
 
30
        id: d
 
31
        objectName: "infographicPrivate"
 
32
        property bool useDotAnimation: true
 
33
        property int circleModifier: useDotAnimation ? 1 : 2
 
34
        property bool animating: dotHideAnimTimer.running
 
35
                              || dotShowAnimTimer.running
 
36
                              || circleChangeAnimTimer.running
 
37
    }
31
38
 
32
39
    Connections {
33
40
        target: model
46
53
        dotHideAnimTimer.stop()
47
54
        notification.hideAnim.stop()
48
55
 
49
 
        if (__useDotAnimation) {
 
56
        if (d.useDotAnimation) {
50
57
            dotShowAnimTimer.startFromBeginning()
51
58
        }
52
59
        notification.showAnim.start()
57
64
        circleChangeAnimTimer.stop()
58
65
        notification.showAnim.stop()
59
66
 
60
 
        if (__useDotAnimation) {
 
67
        if (d.useDotAnimation) {
61
68
            dotHideAnimTimer.startFromBeginning()
62
69
        } else {
63
70
            circleChangeAnimTimer.startFromBeginning()
148
155
                                property: "opacity"
149
156
                                to: pastCircle.circleOpacity
150
157
                                easing.type: Easing.OutCurve
151
 
                                duration: circleChangeAnimTimer.interval * __circleModifier
 
158
                                duration: circleChangeAnimTimer.interval * d.circleModifier
152
159
                            }
153
160
                            PropertyAnimation {
154
161
                                target: pastCircle
155
162
                                property: "scale"
156
163
                                to: modelData
157
164
                                easing.type: Easing.OutCurve
158
 
                                duration: circleChangeAnimTimer.interval * __circleModifier
 
165
                                duration: circleChangeAnimTimer.interval * d.circleModifier
159
166
                            }
160
167
                            ColorAnimation {
161
168
                                target: pastCircle
162
169
                                property: "color"
163
170
                                to: Gradient.threeColorByIndex(index, count, infographic.model.secondColor)
164
171
                                easing.type: Easing.OutCurve
165
 
                                duration: circleChangeAnimTimer.interval * __circleModifier
 
172
                                duration: circleChangeAnimTimer.interval * d.circleModifier
166
173
                            }
167
174
                        }
168
175
                    }
209
216
                                property: "opacity"
210
217
                                to: presentCircle.circleOpacity
211
218
                                easing.type: Easing.OutCurve
212
 
                                duration: circleChangeAnimTimer.interval * __circleModifier
 
219
                                duration: circleChangeAnimTimer.interval * d.circleModifier
213
220
                            }
214
221
                            PropertyAnimation {
215
222
                                target: presentCircle
216
223
                                property: "scale"
217
224
                                to: modelData
218
225
                                easing.type: Easing.OutCurve
219
 
                                duration: circleChangeAnimTimer.interval * __circleModifier
 
226
                                duration: circleChangeAnimTimer.interval * d.circleModifier
220
227
                            }
221
228
                            ColorAnimation {
222
229
                                target: presentCircle
223
230
                                property: "color"
224
231
                                to: Gradient.threeColorByIndex(index, infographic.model.currentDay, infographic.model.firstColor)
225
232
                                easing.type: Easing.OutCurve
226
 
                                duration: circleChangeAnimTimer.interval * __circleModifier
 
233
                                duration: circleChangeAnimTimer.interval * d.circleModifier
227
234
                            }
228
235
                        }
229
236
                    }
385
392
                from: notification.baseOpacity
386
393
                to: 0.0
387
394
                duration: notification.duration * dots.count
388
 
                onStopped: if (!__useDotAnimation) infographic.model.readyForDataChange()
 
395
                onStopped: if (!d.useDotAnimation) infographic.model.readyForDataChange()
389
396
            }
390
397
        }
391
398
    }
394
401
        anchors.fill: dataCircle
395
402
 
396
403
        onDoubleClicked: {
397
 
            if (!dotHideAnimTimer.running &&
398
 
                    !dotShowAnimTimer.running &&
399
 
                    !circleChangeAnimTimer.running) {
400
 
                __useDotAnimation = false
 
404
            if (!d.animating) {
 
405
                d.useDotAnimation = false
401
406
                infographic.model.nextDataSource()
402
407
            }
403
408
        }