Merge lp:~nik90/ubuntu-clock-app/replace-addworldcity-button into lp:ubuntu-clock-app

Proposed by Nekhelesh Ramananthan
Status: Merged
Approved by: Nekhelesh Ramananthan
Approved revision: 80
Merged at revision: 83
Proposed branch: lp:~nik90/ubuntu-clock-app/replace-addworldcity-button
Merge into: lp:ubuntu-clock-app
Diff against target: 257 lines (+87/-121)
4 files modified
app/clock/ClockPage.qml (+14/-31)
app/components/PullToAdd.qml (+0/-90)
app/worldclock/AddWorldCityButton.qml (+71/-0)
debian/changelog (+2/-0)
To merge this branch: bzr merge lp:~nik90/ubuntu-clock-app/replace-addworldcity-button
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Riccardo Padovani Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+233349@code.launchpad.net

Commit message

Replaces the add-worldcity button as per the new design change. This should fix accidental trigger and also be more discoverable.

Description of the change

Replaces the add-worldcity button as per the new design change. This should fix accidental trigger and also be more discoverable.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Approved by design. Just requires a code sign off.

Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Only a little nitpick in the code, see inline

Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Inline comment, as I said :D

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Riccardo Padovani (rpadovani) wrote :

lgtm

review: Approve
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

I need to wait for the other branch to land before top-approving this one since there will be a code conflict in debian/changelog file that I need to fix first.

80. By Nekhelesh Ramananthan

Merged trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/clock/ClockPage.qml'
2--- app/clock/ClockPage.qml 2014-09-04 16:21:45 +0000
3+++ app/clock/ClockPage.qml 2014-09-04 22:04:12 +0000
4@@ -28,12 +28,6 @@
5 id: _clockPage
6 objectName: "clockPage"
7
8- /*
9- Property to set the minimum drag distance before activating the add
10- city signal
11- */
12- property int _minThreshold: addCityButton.maxThreshold + units.gu(2)
13-
14 // Property to keep track of the clock mode
15 property alias isDigital: clock.isDigital
16
17@@ -49,21 +43,8 @@
18 anchors.fill: parent
19 contentWidth: parent.width
20 contentHeight: clock.height + date.height + locationRow.height
21- + worldCityColumn.height + units.gu(14)
22-
23- PullToAdd {
24- id: addCityButton
25- objectName: "addCityButton"
26-
27- anchors {
28- top: parent.top
29- topMargin: -labelHeight - units.gu(3)
30- horizontalCenter: parent.horizontalCenter
31- }
32-
33- leftLabel: i18n.tr("Add")
34- rightLabel: i18n.tr("City")
35- }
36+ + worldCityColumn.height + addWorldCityButton.height
37+ + units.gu(16)
38
39 AbstractButton {
40 id: settingsIcon
41@@ -160,20 +141,22 @@
42 UserWorldCityList {
43 id: worldCityColumn
44 objectName: "worldCityColumn"
45+
46 opacity: settingsIcon.opacity
47- anchors.top: locationRow.bottom
48- anchors.topMargin: units.gu(4)
49- }
50-
51- onDragEnded: {
52- if(contentY < _minThreshold) {
53- mainStack.push(Qt.resolvedUrl("../worldclock/WorldCityList.qml"))
54+ anchors {
55+ top: locationRow.bottom
56+ topMargin: units.gu(4)
57 }
58 }
59
60- onContentYChanged: {
61- if(contentY < 0 && atYBeginning) {
62- addCityButton.dragPosition = contentY.toFixed(0)
63+ AddWorldCityButton {
64+ id: addWorldCityButton
65+
66+ opacity: settingsIcon.opacity
67+ anchors {
68+ top: worldCityColumn.bottom
69+ topMargin: units.gu(1)
70+ horizontalCenter: parent.horizontalCenter
71 }
72 }
73
74
75=== removed file 'app/components/PullToAdd.qml'
76--- app/components/PullToAdd.qml 2014-08-24 12:47:50 +0000
77+++ app/components/PullToAdd.qml 1970-01-01 00:00:00 +0000
78@@ -1,90 +0,0 @@
79-/*
80- * Copyright (C) 2014 Canonical Ltd
81- *
82- * This file is part of Ubuntu Clock App
83- *
84- * Ubuntu Clock App is free software: you can redistribute it and/or modify
85- * it under the terms of the GNU General Public License version 3 as
86- * published by the Free Software Foundation.
87- *
88- * Ubuntu Clock App is distributed in the hope that it will be useful,
89- * but WITHOUT ANY WARRANTY; without even the implied warranty of
90- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
91- * GNU General Public License for more details.
92- *
93- * You should have received a copy of the GNU General Public License
94- * along with this program. If not, see <http://www.gnu.org/licenses/>.
95- */
96-
97-import QtQuick 2.3
98-import Ubuntu.Components 1.1
99-
100-Row {
101- id: _pullToAdd
102-
103- // Property to get the position of the button from the top
104- property int dragPosition: 0
105-
106- // Property to store the height of the label
107- property alias labelHeight: _leftLabel.height
108-
109- // Property to set the label on the left side of the add button
110- property alias leftLabel: _leftLabel.text
111-
112- // Property to set the label on the right side of the add button
113- property alias rightLabel: _rightLabel.text
114-
115- // Property to set the maximum threshold beyond which the button shouldn't
116- // resize
117- property int maxThreshold: -units.gu(8)
118-
119- // Property to set the maximum size of the plus icon
120- property int maxPlusSize: _addButton.width * 0.3
121-
122- spacing: units.gu(1)
123-
124- Label {
125- id: _leftLabel
126-
127- text: "pull"
128- fontSize: "medium"
129- color: UbuntuColors.midAubergine
130- anchors.verticalCenter: parent.verticalCenter
131- }
132-
133- ClockCircle {
134- id: _addButton
135-
136- isOuter: true
137- width: dragPosition >= maxThreshold
138- ? dragPosition * units.gu(6.5)/maxThreshold
139- : units.gu(6.5)
140-
141- ClockCircle {
142- width: dragPosition >= maxThreshold
143- ? dragPosition * units.gu(4.5)/maxThreshold
144- : units.gu(4.5)
145- anchors.centerIn: parent
146-
147- Icon {
148- id: plusIcon
149- anchors.centerIn: parent
150- color: UbuntuColors.coolGrey
151- name: "add"
152- height: dragPosition >= maxThreshold
153- ? (dragPosition * maxPlusSize)/maxThreshold
154- : maxPlusSize
155- width: height
156- }
157- }
158- }
159-
160- Label {
161- id: _rightLabel
162-
163- text: "down"
164- fontSize: "medium"
165- color: UbuntuColors.midAubergine
166- anchors.verticalCenter: parent.verticalCenter
167- }
168-}
169
170=== added file 'app/worldclock/AddWorldCityButton.qml'
171--- app/worldclock/AddWorldCityButton.qml 1970-01-01 00:00:00 +0000
172+++ app/worldclock/AddWorldCityButton.qml 2014-09-04 22:04:12 +0000
173@@ -0,0 +1,71 @@
174+/*
175+ * Copyright (C) 2014 Canonical Ltd
176+ *
177+ * This file is part of Ubuntu Clock App
178+ *
179+ * Ubuntu Clock App is free software: you can redistribute it and/or modify
180+ * it under the terms of the GNU General Public License version 3 as
181+ * published by the Free Software Foundation.
182+ *
183+ * Ubuntu Clock App is distributed in the hope that it will be useful,
184+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
185+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
186+ * GNU General Public License for more details.
187+ *
188+ * You should have received a copy of the GNU General Public License
189+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
190+ */
191+
192+import QtQuick 2.3
193+import Ubuntu.Components 1.1
194+import "../components"
195+
196+AbstractButton {
197+ id: addWorldCityButton
198+
199+ width: childrenRect.width
200+ height: childrenRect.height
201+
202+ Row {
203+ spacing: units.gu(1)
204+
205+ width: childrenRect.width
206+ height: _addButton.height
207+
208+ Label {
209+ text: i18n.tr("Add")
210+ color: UbuntuColors.midAubergine
211+ anchors.verticalCenter: parent.verticalCenter
212+ }
213+
214+ ClockCircle {
215+ id: _addButton
216+
217+ isOuter: true
218+ width: units.gu(5)
219+
220+ ClockCircle {
221+ width: units.gu(3.5)
222+ anchors.centerIn: parent
223+
224+ Icon {
225+ anchors.centerIn: parent
226+ color: UbuntuColors.coolGrey
227+ name: "add"
228+ height: units.gu(2)
229+ width: height
230+ }
231+ }
232+ }
233+
234+ Label {
235+ text: i18n.tr("City")
236+ color: UbuntuColors.midAubergine
237+ anchors.verticalCenter: parent.verticalCenter
238+ }
239+ }
240+
241+ onClicked: {
242+ pageStack.push(Qt.resolvedUrl("WorldCityList.qml"))
243+ }
244+}
245
246=== modified file 'debian/changelog'
247--- debian/changelog 2014-09-04 22:01:50 +0000
248+++ debian/changelog 2014-09-04 22:04:12 +0000
249@@ -27,6 +27,8 @@
250 * Added utc as a city (LP: #1362763)
251 * Increase size of alarm volume listitem and simplified alarm duration list model.
252 * Added pressed visual state to the settings button (LP: #1364553)
253+ * Fixed no UI hint being show to add cities (LP: #1362263)
254+ * Fixed add world city being triggered accidentally (LP: #1359180)
255
256 [Zsombor Egri]
257 * Fixed alarm status toggle being reverted immediately (LP: #1272337)

Subscribers

People subscribed via source and target branches