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

« back to all changes in this revision

Viewing changes to app/clock/ClockPage.qml

  • Committer: Nekhelesh Ramananthan
  • Date: 2014-07-29 12:00:28 UTC
  • mto: (37.1.1 reboot)
  • mto: This revision was merged to the branch mainline in revision 37.
  • Revision ID: krnekhelesh@gmail.com-20140729120028-821ujpa5c9li7w5a
Remove hardcoded time format in the settings page and follow the user locale

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    Flickable {
43
43
        id: _flickable
44
44
 
45
 
        Component.onCompleted: otherElementsStartUpAnimation.start()
46
 
 
47
45
        anchors.fill: parent
48
46
        contentWidth: parent.width
49
47
        contentHeight: clock.height + date.height + locationRow.height
52
50
        PullToAdd {
53
51
            id: addCityButton
54
52
 
55
 
            anchors {
56
 
                top: parent.top
57
 
                topMargin: -labelHeight - units.gu(3)
58
 
                horizontalCenter: parent.horizontalCenter
59
 
            }
 
53
            anchors.top: parent.top
 
54
            anchors.topMargin: -labelHeight - units.gu(3)
 
55
            anchors.horizontalCenter: parent.horizontalCenter
60
56
 
61
57
            leftLabel: i18n.tr("Add")
62
58
            rightLabel: i18n.tr("City")
63
59
        }
64
60
 
65
 
        AbstractButton {
 
61
        Icon {
66
62
            id: settingsIcon
67
63
 
68
 
            onClicked: {
69
 
                mainStack.push(Qt.resolvedUrl("../alarm/AlarmSettingsPage.qml"))
70
 
            }
 
64
            Component.onCompleted: anchors.topMargin = units.gu(2)
71
65
 
72
66
            width: units.gu(3)
73
67
            height: width
74
 
            opacity: 0
75
68
 
76
69
            anchors {
77
70
                top: parent.top
80
73
                rightMargin: units.gu(2)
81
74
            }
82
75
 
83
 
            Icon {
 
76
            name: "settings"
 
77
            color: "Grey"
 
78
 
 
79
            Behavior on anchors.topMargin {
 
80
                UbuntuNumberAnimation { duration: 900 }
 
81
            }
 
82
 
 
83
            MouseArea {
84
84
                anchors.fill: parent
85
 
                name: "settings"
86
 
                color: "Grey"
 
85
                onClicked: mainStack.push(
 
86
                               Qt.resolvedUrl("../alarm/AlarmSettingsPage.qml"))
87
87
            }
88
88
        }
89
89
 
90
90
        MainClock {
91
91
            id: clock
92
92
 
93
 
            anchors {
94
 
                verticalCenter: parent.top
95
 
                verticalCenterOffset: units.gu(20)
96
 
                horizontalCenter: parent.horizontalCenter
97
 
            }
 
93
            anchors.verticalCenter: parent.top
 
94
            anchors.verticalCenterOffset: units.gu(20)
 
95
            anchors.horizontalCenter: parent.horizontalCenter
98
96
        }
99
97
 
100
98
        Label {
101
99
            id: date
102
100
 
103
 
            anchors {
104
 
                top: parent.top
105
 
                topMargin: units.gu(36)
106
 
                horizontalCenter: parent.horizontalCenter
107
 
            }
108
 
 
109
 
            text: clock.analogTime.toLocaleDateString()
110
 
            opacity: settingsIcon.opacity
 
101
            Component.onCompleted: anchors.topMargin = units.gu(40)
 
102
 
 
103
            anchors.top: parent.top
 
104
            anchors.topMargin: units.gu(36)
 
105
            anchors.horizontalCenter: parent.horizontalCenter
 
106
 
 
107
            text: Qt.formatDate(clock.analogTime, "dddd, d MMMM yyyy")
111
108
            fontSize: "xx-small"
 
109
 
 
110
            Behavior on anchors.topMargin {
 
111
                UbuntuNumberAnimation { duration: 900 }
 
112
            }
112
113
        }
113
114
 
114
115
        Row {
115
116
            id: locationRow
116
117
 
117
 
            opacity: settingsIcon.opacity
118
118
            spacing: units.gu(1)
119
119
 
120
 
            anchors {
121
 
                top: date.bottom
122
 
                topMargin: units.gu(1)
123
 
                horizontalCenter: parent.horizontalCenter
124
 
            }
 
120
            anchors.top: date.bottom
 
121
            anchors.topMargin: units.gu(1)
 
122
            anchors.horizontalCenter: parent.horizontalCenter
125
123
 
126
124
            Image {
127
125
                id: locationIcon
141
139
 
142
140
        UserWorldCityList {
143
141
            id: worldCityColumn
144
 
            opacity: settingsIcon.opacity
145
142
        }
146
143
 
147
144
        onDragEnded: {
155
152
                addCityButton.dragPosition = contentY.toFixed(0)
156
153
            }
157
154
        }
158
 
 
159
 
        ParallelAnimation {
160
 
            id: otherElementsStartUpAnimation
161
 
 
162
 
            PropertyAnimation {
163
 
                target: settingsIcon
164
 
                property: "anchors.topMargin"
165
 
                from: units.gu(6)
166
 
                to: units.gu(2)
167
 
                duration: 900
168
 
            }
169
 
 
170
 
            PropertyAnimation {
171
 
                target: settingsIcon
172
 
                property: "opacity"
173
 
                from: 0
174
 
                to: 1
175
 
                duration: 900
176
 
            }
177
 
 
178
 
            PropertyAnimation {
179
 
                target: date
180
 
                property: "anchors.topMargin"
181
 
                from: units.gu(36)
182
 
                to: units.gu(40)
183
 
                duration: 900
184
 
            }
185
 
        }
186
155
    }
187
156
}