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

« back to all changes in this revision

Viewing changes to app/worldclock/UserWorldCityList.qml

Bare working version

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
            removable: true
75
75
            confirmRemoval: true
76
76
 
77
 
            Label {
78
 
                id: localTimeLabel
 
77
            Clock {
 
78
                id: localTimeVisual
 
79
 
 
80
                function getTime(timeString) {
 
81
                    var properTime = new Date()
 
82
                    properTime.setHours(timeString.split(":")[0])
 
83
                    properTime.setMinutes(timeString.split(":")[1])
 
84
                    properTime.setSeconds(0)
 
85
                    return properTime
 
86
                }
 
87
 
 
88
                fontSize: units.dp(14)
 
89
                periodFontSize: units.dp(10)
 
90
                innerCircleWidth: units.gu(5)
 
91
                width: units.gu(7)
 
92
 
 
93
                analogTime: getTime(model.localTime)
 
94
                time: model.localTime
79
95
 
80
96
                anchors.centerIn: parent
81
 
                fontSize: "large"
82
 
                text: model.localTime
 
97
 
 
98
                Connections {
 
99
                    target: clock
 
100
                    onTriggerFlip: {
 
101
                        localTimeVisual.flipClock()
 
102
                    }
 
103
                }
 
104
 
 
105
                Component.onCompleted: {
 
106
                    isDigital = clockModeDocument.contents.digitalMode ? true : false
 
107
                    if (clockModeDocument.contents.digitalMode) {
 
108
                        digitalModeLoader.setSource(
 
109
                                    "../components/DigitalMode.qml",
 
110
                                    {
 
111
                                        "width": innerCircleWidth,
 
112
                                        "timeFontSize": fontSize,
 
113
                                        "timePeriodFontSize": periodFontSize
 
114
                                    })
 
115
                    }
 
116
                    else {
 
117
                        analogModeLoader.setSource(
 
118
                                    "../components/AnalogMode.qml",
 
119
                                    {
 
120
                                        "width": innerCircleWidth
 
121
                                    })
 
122
                    }
 
123
                }
83
124
            }
84
125
 
85
126
            Label {