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
=== modified file 'app/clock/ClockPage.qml'
--- app/clock/ClockPage.qml 2014-09-04 16:21:45 +0000
+++ app/clock/ClockPage.qml 2014-09-04 22:04:12 +0000
@@ -28,12 +28,6 @@
28 id: _clockPage28 id: _clockPage
29 objectName: "clockPage"29 objectName: "clockPage"
3030
31 /*
32 Property to set the minimum drag distance before activating the add
33 city signal
34 */
35 property int _minThreshold: addCityButton.maxThreshold + units.gu(2)
36
37 // Property to keep track of the clock mode31 // Property to keep track of the clock mode
38 property alias isDigital: clock.isDigital32 property alias isDigital: clock.isDigital
3933
@@ -49,21 +43,8 @@
49 anchors.fill: parent43 anchors.fill: parent
50 contentWidth: parent.width44 contentWidth: parent.width
51 contentHeight: clock.height + date.height + locationRow.height45 contentHeight: clock.height + date.height + locationRow.height
52 + worldCityColumn.height + units.gu(14)46 + worldCityColumn.height + addWorldCityButton.height
5347 + units.gu(16)
54 PullToAdd {
55 id: addCityButton
56 objectName: "addCityButton"
57
58 anchors {
59 top: parent.top
60 topMargin: -labelHeight - units.gu(3)
61 horizontalCenter: parent.horizontalCenter
62 }
63
64 leftLabel: i18n.tr("Add")
65 rightLabel: i18n.tr("City")
66 }
6748
68 AbstractButton {49 AbstractButton {
69 id: settingsIcon50 id: settingsIcon
@@ -160,20 +141,22 @@
160 UserWorldCityList {141 UserWorldCityList {
161 id: worldCityColumn142 id: worldCityColumn
162 objectName: "worldCityColumn"143 objectName: "worldCityColumn"
144
163 opacity: settingsIcon.opacity145 opacity: settingsIcon.opacity
164 anchors.top: locationRow.bottom146 anchors {
165 anchors.topMargin: units.gu(4)147 top: locationRow.bottom
166 }148 topMargin: units.gu(4)
167
168 onDragEnded: {
169 if(contentY < _minThreshold) {
170 mainStack.push(Qt.resolvedUrl("../worldclock/WorldCityList.qml"))
171 }149 }
172 }150 }
173151
174 onContentYChanged: {152 AddWorldCityButton {
175 if(contentY < 0 && atYBeginning) {153 id: addWorldCityButton
176 addCityButton.dragPosition = contentY.toFixed(0)154
155 opacity: settingsIcon.opacity
156 anchors {
157 top: worldCityColumn.bottom
158 topMargin: units.gu(1)
159 horizontalCenter: parent.horizontalCenter
177 }160 }
178 }161 }
179162
180163
=== removed file 'app/components/PullToAdd.qml'
--- app/components/PullToAdd.qml 2014-08-24 12:47:50 +0000
+++ app/components/PullToAdd.qml 1970-01-01 00:00:00 +0000
@@ -1,90 +0,0 @@
1/*
2 * Copyright (C) 2014 Canonical Ltd
3 *
4 * This file is part of Ubuntu Clock App
5 *
6 * Ubuntu Clock App is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 3 as
8 * published by the Free Software Foundation.
9 *
10 * Ubuntu Clock App is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import QtQuick 2.3
20import Ubuntu.Components 1.1
21
22Row {
23 id: _pullToAdd
24
25 // Property to get the position of the button from the top
26 property int dragPosition: 0
27
28 // Property to store the height of the label
29 property alias labelHeight: _leftLabel.height
30
31 // Property to set the label on the left side of the add button
32 property alias leftLabel: _leftLabel.text
33
34 // Property to set the label on the right side of the add button
35 property alias rightLabel: _rightLabel.text
36
37 // Property to set the maximum threshold beyond which the button shouldn't
38 // resize
39 property int maxThreshold: -units.gu(8)
40
41 // Property to set the maximum size of the plus icon
42 property int maxPlusSize: _addButton.width * 0.3
43
44 spacing: units.gu(1)
45
46 Label {
47 id: _leftLabel
48
49 text: "pull"
50 fontSize: "medium"
51 color: UbuntuColors.midAubergine
52 anchors.verticalCenter: parent.verticalCenter
53 }
54
55 ClockCircle {
56 id: _addButton
57
58 isOuter: true
59 width: dragPosition >= maxThreshold
60 ? dragPosition * units.gu(6.5)/maxThreshold
61 : units.gu(6.5)
62
63 ClockCircle {
64 width: dragPosition >= maxThreshold
65 ? dragPosition * units.gu(4.5)/maxThreshold
66 : units.gu(4.5)
67 anchors.centerIn: parent
68
69 Icon {
70 id: plusIcon
71 anchors.centerIn: parent
72 color: UbuntuColors.coolGrey
73 name: "add"
74 height: dragPosition >= maxThreshold
75 ? (dragPosition * maxPlusSize)/maxThreshold
76 : maxPlusSize
77 width: height
78 }
79 }
80 }
81
82 Label {
83 id: _rightLabel
84
85 text: "down"
86 fontSize: "medium"
87 color: UbuntuColors.midAubergine
88 anchors.verticalCenter: parent.verticalCenter
89 }
90}
910
=== added file 'app/worldclock/AddWorldCityButton.qml'
--- app/worldclock/AddWorldCityButton.qml 1970-01-01 00:00:00 +0000
+++ app/worldclock/AddWorldCityButton.qml 2014-09-04 22:04:12 +0000
@@ -0,0 +1,71 @@
1/*
2 * Copyright (C) 2014 Canonical Ltd
3 *
4 * This file is part of Ubuntu Clock App
5 *
6 * Ubuntu Clock App is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 3 as
8 * published by the Free Software Foundation.
9 *
10 * Ubuntu Clock App is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import QtQuick 2.3
20import Ubuntu.Components 1.1
21import "../components"
22
23AbstractButton {
24 id: addWorldCityButton
25
26 width: childrenRect.width
27 height: childrenRect.height
28
29 Row {
30 spacing: units.gu(1)
31
32 width: childrenRect.width
33 height: _addButton.height
34
35 Label {
36 text: i18n.tr("Add")
37 color: UbuntuColors.midAubergine
38 anchors.verticalCenter: parent.verticalCenter
39 }
40
41 ClockCircle {
42 id: _addButton
43
44 isOuter: true
45 width: units.gu(5)
46
47 ClockCircle {
48 width: units.gu(3.5)
49 anchors.centerIn: parent
50
51 Icon {
52 anchors.centerIn: parent
53 color: UbuntuColors.coolGrey
54 name: "add"
55 height: units.gu(2)
56 width: height
57 }
58 }
59 }
60
61 Label {
62 text: i18n.tr("City")
63 color: UbuntuColors.midAubergine
64 anchors.verticalCenter: parent.verticalCenter
65 }
66 }
67
68 onClicked: {
69 pageStack.push(Qt.resolvedUrl("WorldCityList.qml"))
70 }
71}
072
=== modified file 'debian/changelog'
--- debian/changelog 2014-09-04 22:01:50 +0000
+++ debian/changelog 2014-09-04 22:04:12 +0000
@@ -27,6 +27,8 @@
27 * Added utc as a city (LP: #1362763)27 * Added utc as a city (LP: #1362763)
28 * Increase size of alarm volume listitem and simplified alarm duration list model.28 * Increase size of alarm volume listitem and simplified alarm duration list model.
29 * Added pressed visual state to the settings button (LP: #1364553)29 * Added pressed visual state to the settings button (LP: #1364553)
30 * Fixed no UI hint being show to add cities (LP: #1362263)
31 * Fixed add world city being triggered accidentally (LP: #1359180)
3032
31 [Zsombor Egri]33 [Zsombor Egri]
32 * Fixed alarm status toggle being reverted immediately (LP: #1272337)34 * Fixed alarm status toggle being reverted immediately (LP: #1272337)

Subscribers

People subscribed via source and target branches