~ubuntu-clock-dev/ubuntu-clock-app/reboot-packaging

« back to all changes in this revision

Viewing changes to app/components/Clock.qml

Bare working version

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
    property alias digitalModeLoader: _digitalModeLoader
41
41
    property alias analogModeLoader: _analogModeLoader
42
42
 
 
43
    signal triggerFlip();
 
44
 
 
45
    function flipClock() {
 
46
        clockFlipAnimation.start()
 
47
    }
 
48
 
43
49
    // Sets the style to outer circle
44
50
    isOuter: true
45
51
 
120
126
                clockFlipAnimation.start()
121
127
            }
122
128
        }
123
 
 
124
 
        onStateChanged: {
125
 
            if(!isMainClock) {
126
 
                console.log(state)
127
 
                clockFlipAnimation.start()
128
 
            }
129
 
        }
130
129
    }
131
130
 
132
131
    /*
138
137
 
139
138
        ScriptAction {
140
139
            script: {
 
140
 
 
141
                if(isMainClock) {
 
142
                    triggerFlip()
 
143
                }
141
144
                analogShadow.setSource("AnalogShadow.qml",
142
145
                                       {
143
 
                                           "shadowWidth": units.gu(23),
144
 
                                           "shadowTimeFontSize": units.dp(62),
145
 
                                           "shadowPeriodFontSize": units.dp(12),
 
146
                                           "shadowWidth": innerCircleWidth,
 
147
                                           "shadowTimeFontSize": fontSize,
 
148
                                           "shadowPeriodFontSize": periodFontSize,
146
149
                                       })
147
150
                digitalShadow.setSource("DigitalShadow.qml",
148
151
                                        {
149
 
                                            "shadowWidth": units.gu(23),
150
 
                                            "shadowTimeFontSize": units.dp(62),
151
 
                                            "shadowPeriodFontSize": units.dp(12),
 
152
                                            "shadowWidth": innerCircleWidth,
 
153
                                            "shadowTimeFontSize": fontSize,
 
154
                                            "shadowPeriodFontSize": periodFontSize,
152
155
                                        })
153
156
 
154
157
                if (clockModeFlipable.isDigital) {
187
190
 
188
191
        ScriptAction {
189
192
            script: {
 
193
 
 
194
 
190
195
                upperShadow.opacity = bottomShadow.opacity = 0
191
196
                clockModeFlipable.isDigital = !clockModeFlipable.isDigital
192
197
 
195
200
                    _digitalModeLoader.setSource(
196
201
                                "DigitalMode.qml",
197
202
                                {
198
 
                                    "width": _outerCircle.innerCircleWidth,
199
 
                                    "timeFontSize": _outerCircle.fontSize,
200
 
                                    "timePeriodFontSize": _outerCircle.periodFontSize
 
203
                                    "width": innerCircleWidth,
 
204
                                    "timeFontSize": fontSize,
 
205
                                    "timePeriodFontSize": periodFontSize
201
206
                                })
202
207
                    Utils.log(debugMode, "Unloaded Analog mode...")
203
208
                    _analogModeLoader.source = ""