Merge lp:~nik90/ubuntu-clock-app/dynamic-positioning-part1 into lp:ubuntu-clock-app/saucy
- dynamic-positioning-part1
- Merge into saucy
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Nekhelesh Ramananthan | ||||||||
Approved revision: | 209 | ||||||||
Merged at revision: | 200 | ||||||||
Proposed branch: | lp:~nik90/ubuntu-clock-app/dynamic-positioning-part1 | ||||||||
Merge into: | lp:ubuntu-clock-app/saucy | ||||||||
Diff against target: |
403 lines (+79/-101) 6 files modified
clock/ClockPage.qml (+14/-8) common/AnimationContainer.qml (+0/-50) stopwatch/StopwatchPage.qml (+13/-7) tests/autopilot/ubuntu_clock_app/tests/test_timer.py (+2/-2) timer/TimerPage.qml (+50/-28) ubuntu-clock-app.qml (+0/-6) |
||||||||
To merge this branch: | bzr merge lp:~nik90/ubuntu-clock-app/dynamic-positioning-part1 | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Paolo Rotolo (community) | Approve | ||
Review via email: mp+186564@code.launchpad.net |
Commit message
Replaces static positioning of components with Dynamic positioning to allow for different screen size variation.
Description of the change
This MP removes some of the hardcoded positioning of certain components. Static positioning of components results in components hidden or not appearing as expecting. It replaces AnimationContainer with just ordinary flickables which are supported well by the SDK.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:208
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:209
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) : | # |
Preview Diff
1 | === modified file 'clock/ClockPage.qml' | |||
2 | --- clock/ClockPage.qml 2013-09-09 17:06:20 +0000 | |||
3 | +++ clock/ClockPage.qml 2013-09-21 10:37:18 +0000 | |||
4 | @@ -28,8 +28,6 @@ | |||
5 | 28 | Page { | 28 | Page { |
6 | 29 | id: clockPage; | 29 | id: clockPage; |
7 | 30 | 30 | ||
8 | 31 | flickable: null | ||
9 | 32 | |||
10 | 33 | // Property to hold the formatted time string to show on the screen | 31 | // Property to hold the formatted time string to show on the screen |
11 | 34 | property string currentTimeFormatted | 32 | property string currentTimeFormatted |
12 | 35 | property real currentTimeStamp | 33 | property real currentTimeStamp |
13 | @@ -72,9 +70,14 @@ | |||
14 | 72 | currentTimeStamp = now.getTime(); | 70 | currentTimeStamp = now.getTime(); |
15 | 73 | } | 71 | } |
16 | 74 | 72 | ||
18 | 75 | AnimationContainer { | 73 | Flickable { |
19 | 76 | id: clockAnimationContainer | 74 | id: clockAnimationContainer |
20 | 77 | 75 | ||
21 | 76 | clip: true; | ||
22 | 77 | anchors.fill: parent | ||
23 | 78 | contentWidth: parent.width | ||
24 | 79 | contentHeight: clockFace.height + clockFace.anchors.topMargin + savedWorldClock.height + savedWorldClock.anchors.topMargin + units.gu(3) | ||
25 | 80 | |||
26 | 78 | // Label to show the current time | 81 | // Label to show the current time |
27 | 79 | Rectangle { | 82 | Rectangle { |
28 | 80 | id: labelContainer; | 83 | id: labelContainer; |
29 | @@ -101,7 +104,7 @@ | |||
30 | 101 | AnalogClockFace { | 104 | AnalogClockFace { |
31 | 102 | id: clockFace | 105 | id: clockFace |
32 | 103 | 106 | ||
34 | 104 | anchors { top: parent.top; topMargin: units.gu(9); horizontalCenter: parent.horizontalCenter } | 107 | anchors { top: parent.top; topMargin: units.gu(10); horizontalCenter: parent.horizontalCenter } |
35 | 105 | 108 | ||
36 | 106 | onClicked: { | 109 | onClicked: { |
37 | 107 | if (easterEggCircle.isReady == XmlListModel.Ready) { | 110 | if (easterEggCircle.isReady == XmlListModel.Ready) { |
38 | @@ -138,12 +141,15 @@ | |||
39 | 138 | Column { | 141 | Column { |
40 | 139 | id: savedWorldClock | 142 | id: savedWorldClock |
41 | 140 | 143 | ||
42 | 144 | property int dynamicTopSpacing: clockPage.height - clockPage.header.height - clockFace.height - locationHeader.height - clockFace.anchors.topMargin - divider.height; | ||
43 | 145 | |||
44 | 141 | height: childrenRect.height; | 146 | height: childrenRect.height; |
46 | 142 | anchors { left:parent.left; right:parent.right; top: clockFace.bottom; topMargin: units.gu(13)} | 147 | anchors { left:parent.left; right:parent.right; top: clockFace.bottom; topMargin: savedWorldClock.dynamicTopSpacing } |
47 | 143 | 148 | ||
49 | 144 | ListItem.ThinDivider {} | 149 | ListItem.ThinDivider { id: divider } |
50 | 145 | 150 | ||
51 | 146 | ListItem.Header { | 151 | ListItem.Header { |
52 | 152 | id: locationHeader | ||
53 | 147 | Label { | 153 | Label { |
54 | 148 | text: i18n.tr("Current Location") | 154 | text: i18n.tr("Current Location") |
55 | 149 | anchors { verticalCenter: parent.verticalCenter; left: parent.left; leftMargin: units.gu(2) } | 155 | anchors { verticalCenter: parent.verticalCenter; left: parent.left; leftMargin: units.gu(2) } |
56 | @@ -182,8 +188,8 @@ | |||
57 | 182 | id: listWorldClocks | 188 | id: listWorldClocks |
58 | 183 | 189 | ||
59 | 184 | clip: true | 190 | clip: true |
62 | 185 | anchors { left: parent.left; right: parent.right } | 191 | anchors { left: parent.left; right: parent.right } |
63 | 186 | height: units.gu(21) | 192 | height: 3 * units.gu(6) + units.gu(1) // height is defined to show 3 items by default with a small margin |
64 | 187 | model: worldModel | 193 | model: worldModel |
65 | 188 | currentIndex: -1 | 194 | currentIndex: -1 |
66 | 189 | 195 | ||
67 | 190 | 196 | ||
68 | === removed file 'common/AnimationContainer.qml' | |||
69 | --- common/AnimationContainer.qml 2013-07-25 15:02:06 +0000 | |||
70 | +++ common/AnimationContainer.qml 1970-01-01 00:00:00 +0000 | |||
71 | @@ -1,50 +0,0 @@ | |||
72 | 1 | /* | ||
73 | 2 | * Copyright (C) 2013 Canonical Ltd | ||
74 | 3 | * | ||
75 | 4 | * This program is free software: you can redistribute it and/or modify | ||
76 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
77 | 6 | * published by the Free Software Foundation. | ||
78 | 7 | * | ||
79 | 8 | * This program is distributed in the hope that it will be useful, | ||
80 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
81 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
82 | 11 | * GNU General Public License for more details. | ||
83 | 12 | * | ||
84 | 13 | * You should have received a copy of the GNU General Public License | ||
85 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
86 | 15 | * | ||
87 | 16 | * Authored by: Nekhelesh Ramananthan <krnekhelesh@gmail.com> | ||
88 | 17 | * Renato Araujo Oliveira Filho <renato.filho@canonical.com> | ||
89 | 18 | */ | ||
90 | 19 | |||
91 | 20 | import QtQuick 2.0 | ||
92 | 21 | import Ubuntu.Components 0.1 | ||
93 | 22 | |||
94 | 23 | Flickable { | ||
95 | 24 | |||
96 | 25 | //oldContentY: stores the value of contentY when flick movement started | ||
97 | 26 | property int oldContentY: 0 | ||
98 | 27 | //direction: stores the direction (+ or -) and the difference | ||
99 | 28 | //between the old and new values of contentY | ||
100 | 29 | property int direction: contentY - oldContentY | ||
101 | 30 | //Holds the number of pixels that has to move to trigger view change | ||
102 | 31 | property int swipeTolerance: 10 | ||
103 | 32 | |||
104 | 33 | clip: true | ||
105 | 34 | anchors.fill: parent | ||
106 | 35 | contentWidth: parent.width | ||
107 | 36 | contentHeight: units.gu(87) | ||
108 | 37 | |||
109 | 38 | onMovementStarted: oldContentY = contentY | ||
110 | 39 | |||
111 | 40 | onMovementEnded: { | ||
112 | 41 | if(direction > swipeTolerance) | ||
113 | 42 | contentY = contentHeight - parent.height | ||
114 | 43 | else if(direction < -swipeTolerance) | ||
115 | 44 | contentY = 0; | ||
116 | 45 | } | ||
117 | 46 | |||
118 | 47 | Behavior on contentY { | ||
119 | 48 | UbuntuNumberAnimation { duration: UbuntuAnimation.SlowDuration } | ||
120 | 49 | } | ||
121 | 50 | } | ||
122 | 51 | 0 | ||
123 | === modified file 'stopwatch/StopwatchPage.qml' | |||
124 | --- stopwatch/StopwatchPage.qml 2013-09-03 20:06:28 +0000 | |||
125 | +++ stopwatch/StopwatchPage.qml 2013-09-21 10:37:18 +0000 | |||
126 | @@ -28,8 +28,6 @@ | |||
127 | 28 | Page { | 28 | Page { |
128 | 29 | id: stopwatchPage | 29 | id: stopwatchPage |
129 | 30 | 30 | ||
130 | 31 | flickable: null | ||
131 | 32 | |||
132 | 33 | property alias lapStart: laps.lapStart | 31 | property alias lapStart: laps.lapStart |
133 | 34 | 32 | ||
134 | 35 | Component.onCompleted: { | 33 | Component.onCompleted: { |
135 | @@ -59,9 +57,14 @@ | |||
136 | 59 | } | 57 | } |
137 | 60 | 58 | ||
138 | 61 | // Items within this container will move up/down depending on the state. | 59 | // Items within this container will move up/down depending on the state. |
140 | 62 | AnimationContainer { | 60 | Flickable { |
141 | 63 | id: stopwatchAnimationContainer | 61 | id: stopwatchAnimationContainer |
142 | 64 | 62 | ||
143 | 63 | clip: true | ||
144 | 64 | anchors.fill: parent | ||
145 | 65 | contentWidth: parent.width | ||
146 | 66 | contentHeight: analogStopwatch.height + analogStopwatch.anchors.topMargin + listLap.height + listLap.anchors.topMargin + units.gu(3) | ||
147 | 67 | |||
148 | 65 | // Label to show the current time | 68 | // Label to show the current time |
149 | 66 | Item { | 69 | Item { |
150 | 67 | id: labelContainer; | 70 | id: labelContainer; |
151 | @@ -89,7 +92,7 @@ | |||
152 | 89 | id: analogStopwatch | 92 | id: analogStopwatch |
153 | 90 | objectName: "buttonStopwatch" | 93 | objectName: "buttonStopwatch" |
154 | 91 | 94 | ||
156 | 92 | anchors { top: parent.top; topMargin: units.gu(9); horizontalCenter: parent.horizontalCenter } | 95 | anchors { top: parent.top; topMargin: units.gu(10); horizontalCenter: parent.horizontalCenter } |
157 | 93 | 96 | ||
158 | 94 | MouseArea { | 97 | MouseArea { |
159 | 95 | anchors.fill: analogStopwatch.innerCircle; | 98 | anchors.fill: analogStopwatch.innerCircle; |
160 | @@ -153,12 +156,15 @@ | |||
161 | 153 | Column { | 156 | Column { |
162 | 154 | id: listLap | 157 | id: listLap |
163 | 155 | 158 | ||
164 | 159 | property int dynamicTopSpacing: stopwatchPage.height - stopwatchPage.header.height - analogStopwatch.height - locationHeader.height - analogStopwatch.anchors.topMargin - divider.height; | ||
165 | 160 | |||
166 | 156 | height: childrenRect.height | 161 | height: childrenRect.height |
168 | 157 | anchors { left: parent.left; right: parent.right; top: analogStopwatch.bottom; topMargin: units.gu(13) } | 162 | anchors { left: parent.left; right: parent.right; top: analogStopwatch.bottom; topMargin: listLap.dynamicTopSpacing } |
169 | 158 | 163 | ||
171 | 159 | ListItem.ThinDivider {} | 164 | ListItem.ThinDivider { id: divider} |
172 | 160 | 165 | ||
173 | 161 | ListItem.Header { | 166 | ListItem.Header { |
174 | 167 | id: locationHeader | ||
175 | 162 | Label { | 168 | Label { |
176 | 163 | text: i18n.tr("Laps") | 169 | text: i18n.tr("Laps") |
177 | 164 | anchors { verticalCenter: parent.verticalCenter; left: parent.left; leftMargin: units.gu(2) } | 170 | anchors { verticalCenter: parent.verticalCenter; left: parent.left; leftMargin: units.gu(2) } |
178 | @@ -197,7 +203,7 @@ | |||
179 | 197 | 203 | ||
180 | 198 | clip: true | 204 | clip: true |
181 | 199 | anchors { left: parent.left; right: parent.right; } | 205 | anchors { left: parent.left; right: parent.right; } |
183 | 200 | height: units.gu(21) | 206 | height: 3 * units.gu(6) + units.gu(1) |
184 | 201 | model: laps | 207 | model: laps |
185 | 202 | 208 | ||
186 | 203 | delegate: ListItem.Standard { | 209 | delegate: ListItem.Standard { |
187 | 204 | 210 | ||
188 | === modified file 'tests/autopilot/ubuntu_clock_app/tests/test_timer.py' | |||
189 | --- tests/autopilot/ubuntu_clock_app/tests/test_timer.py 2013-09-12 17:48:47 +0000 | |||
190 | +++ tests/autopilot/ubuntu_clock_app/tests/test_timer.py 2013-09-21 10:37:18 +0000 | |||
191 | @@ -50,7 +50,7 @@ | |||
192 | 50 | 50 | ||
193 | 51 | self.pointing_device.drag(tx, ty, tx, ty - h / 3) | 51 | self.pointing_device.drag(tx, ty, tx, ty - h / 3) |
194 | 52 | self.assertThat( | 52 | self.assertThat( |
196 | 53 | timer_page.select_single("AnimationContainer").moving, | 53 | timer_page.select_single("QQuickFlickable", objectName="AnimationContainer").moving, |
197 | 54 | Eventually(Equals(False))) | 54 | Eventually(Equals(False))) |
198 | 55 | 55 | ||
199 | 56 | def drag_page_down_to_previous_state(self): | 56 | def drag_page_down_to_previous_state(self): |
200 | @@ -65,7 +65,7 @@ | |||
201 | 65 | 65 | ||
202 | 66 | self.pointing_device.drag(tx, ty, tx, ty + h / 3) | 66 | self.pointing_device.drag(tx, ty, tx, ty + h / 3) |
203 | 67 | self.assertThat( | 67 | self.assertThat( |
205 | 68 | timer_page.select_single("AnimationContainer").moving, | 68 | timer_page.select_single("QQuickFlickable", objectName="AnimationContainer").moving, |
206 | 69 | Eventually(Equals(False))) | 69 | Eventually(Equals(False))) |
207 | 70 | 70 | ||
208 | 71 | def select_name_preset_label(self): | 71 | def select_name_preset_label(self): |
209 | 72 | 72 | ||
210 | === modified file 'timer/TimerPage.qml' | |||
211 | --- timer/TimerPage.qml 2013-09-14 10:24:04 +0000 | |||
212 | +++ timer/TimerPage.qml 2013-09-21 10:37:18 +0000 | |||
213 | @@ -27,27 +27,25 @@ | |||
214 | 27 | Page { | 27 | Page { |
215 | 28 | id: timerPage | 28 | id: timerPage |
216 | 29 | 29 | ||
217 | 30 | flickable: null | ||
218 | 31 | |||
219 | 32 | property alias minutes: analogTimer.minutes; | 30 | property alias minutes: analogTimer.minutes; |
220 | 33 | property alias seconds: analogTimer.seconds; | 31 | property alias seconds: analogTimer.seconds; |
221 | 34 | property alias totalTime: analogTimer.totalTime; | 32 | property alias totalTime: analogTimer.totalTime; |
222 | 35 | property alias timerOn: analogTimer.timerOn; | 33 | property alias timerOn: analogTimer.timerOn; |
223 | 36 | property string tempNamePreset | 34 | property string tempNamePreset |
225 | 37 | property int pagePostion | 35 | property real tempPosition |
226 | 38 | 36 | ||
227 | 39 | actions: | 37 | actions: |
228 | 40 | Action { | 38 | Action { |
238 | 41 | id: addTimerAction | 39 | id: addTimerAction |
239 | 42 | iconSource: Qt.resolvedUrl("../images/add_icon.png") | 40 | iconSource: Qt.resolvedUrl("../images/add_icon.png") |
240 | 43 | text: i18n.tr("Add Timer") | 41 | text: i18n.tr("Add Timer") |
241 | 44 | description: i18n.tr("Add a new timer") | 42 | description: i18n.tr("Add a new timer") |
242 | 45 | keywords: i18n.tr("Add;Timer;Eggtimer;Preset;Ticker") | 43 | keywords: i18n.tr("Add;Timer;Eggtimer;Preset;Ticker") |
243 | 46 | onTriggered: { | 44 | onTriggered: { |
244 | 47 | reset() | 45 | reset() |
245 | 48 | state = "addPreset" | 46 | state = "addPreset" |
237 | 49 | } | ||
246 | 50 | } | 47 | } |
247 | 48 | } | ||
248 | 51 | 49 | ||
249 | 52 | states: [ | 50 | states: [ |
250 | 53 | State { | 51 | State { |
251 | @@ -67,7 +65,6 @@ | |||
252 | 67 | PropertyChanges { target: cancelPresetToolbarButton; visible: true } | 65 | PropertyChanges { target: cancelPresetToolbarButton; visible: true } |
253 | 68 | PropertyChanges { target: toolbarTimer; locked: true } | 66 | PropertyChanges { target: toolbarTimer; locked: true } |
254 | 69 | PropertyChanges { target: toolbarTimer; opened: true } | 67 | PropertyChanges { target: toolbarTimer; opened: true } |
255 | 70 | PropertyChanges { target: timerAnimationContainer; contentY: 0 } | ||
256 | 71 | } | 68 | } |
257 | 72 | ] | 69 | ] |
258 | 73 | 70 | ||
259 | @@ -94,18 +91,38 @@ | |||
260 | 94 | 91 | ||
261 | 95 | seconds = time % 60 | 92 | seconds = time % 60 |
262 | 96 | time = Math.floor(time / 60) | 93 | time = Math.floor(time / 60) |
264 | 97 | minutes = time % 60 | 94 | minutes = time % 60 |
265 | 98 | 95 | ||
266 | 99 | return Utils.zeroleft(minutes, 2) + ":" + Utils.zeroleft(seconds, 2); | 96 | return Utils.zeroleft(minutes, 2) + ":" + Utils.zeroleft(seconds, 2); |
267 | 100 | } | 97 | } |
268 | 101 | 98 | ||
270 | 102 | Component.onCompleted: Utils.log("TimerPage loaded"); | 99 | Component.onCompleted: { |
271 | 100 | Utils.log("TimerPage loaded"); | ||
272 | 101 | tempPosition = timerAnimationContainer.contentY | ||
273 | 102 | } | ||
274 | 103 | 103 | ||
276 | 104 | AnimationContainer { | 104 | Flickable { |
277 | 105 | id: timerAnimationContainer | 105 | id: timerAnimationContainer |
281 | 106 | 106 | objectName: "AnimationContainer" | |
282 | 107 | //contentY: presetModel.count != 0 ? units.gu(87) - timerPage.height : 0; | 107 | |
283 | 108 | contentY: pagePostion; | 108 | clip: true; |
284 | 109 | anchors.fill: parent | ||
285 | 110 | interactive: { // Flickable interaction disabled if there are no presets and not in add timer page. | ||
286 | 111 | if (presetModel.count == 0) { | ||
287 | 112 | if (timerPage.state == "addPreset") | ||
288 | 113 | return true | ||
289 | 114 | else | ||
290 | 115 | return false | ||
291 | 116 | } | ||
292 | 117 | else | ||
293 | 118 | return true | ||
294 | 119 | } | ||
295 | 120 | contentWidth: parent.width | ||
296 | 121 | contentHeight: analogTimer.height + analogTimer.anchors.topMargin + listPreset.height + listPreset.anchors.topMargin + units.gu(2) | ||
297 | 122 | |||
298 | 123 | Behavior on contentY { | ||
299 | 124 | UbuntuNumberAnimation { duration: UbuntuAnimation.SlowDuration } | ||
300 | 125 | } | ||
301 | 109 | 126 | ||
302 | 110 | // Label to show the current time | 127 | // Label to show the current time |
303 | 111 | Item { | 128 | Item { |
304 | @@ -149,7 +166,7 @@ | |||
305 | 149 | fillRectangle: parent | 166 | fillRectangle: parent |
306 | 150 | } | 167 | } |
307 | 151 | 168 | ||
309 | 152 | anchors { top: parent.top; topMargin: presetModel.count != 0 ? units.gu(9) : units.gu(12); horizontalCenter: parent.horizontalCenter } | 169 | anchors { top: parent.top; topMargin: units.gu(10); horizontalCenter: parent.horizontalCenter } |
310 | 153 | inProgressFlag: (timerOn == true || analogTimer.state == "DONE") ? true : false; | 170 | inProgressFlag: (timerOn == true || analogTimer.state == "DONE") ? true : false; |
311 | 154 | onSecondsChanged: if (timerOn == true) seconds_timer.restart() | 171 | onSecondsChanged: if (timerOn == true) seconds_timer.restart() |
312 | 155 | else labelTimer.text = intervalToString(minutes, seconds); | 172 | else labelTimer.text = intervalToString(minutes, seconds); |
313 | @@ -258,7 +275,8 @@ | |||
314 | 258 | onClicked: { | 275 | onClicked: { |
315 | 259 | reset(); | 276 | reset(); |
316 | 260 | if (timerPage.state != "addPreset") | 277 | if (timerPage.state != "addPreset") |
318 | 261 | timerAnimationContainer.contentY = presetModel.count != 0 ? units.gu(87) - timerPage.height : 0; | 278 | timerAnimationContainer.contentY = tempPosition |
319 | 279 | |||
320 | 262 | } | 280 | } |
321 | 263 | } | 281 | } |
322 | 264 | 282 | ||
323 | @@ -266,13 +284,16 @@ | |||
324 | 266 | Column { | 284 | Column { |
325 | 267 | id: listPreset | 285 | id: listPreset |
326 | 268 | 286 | ||
327 | 287 | property int dynamicTopSpacing: timerPage.height - timerPage.header.height - analogTimer.height - locationHeader.height - analogTimer.anchors.topMargin - divider.height; | ||
328 | 288 | |||
329 | 269 | height: childrenRect.height | 289 | height: childrenRect.height |
330 | 270 | visible: presetModel.count != 0 ? true : false | 290 | visible: presetModel.count != 0 ? true : false |
332 | 271 | anchors { left: parent.left; right: parent.right; top: analogTimer.bottom; topMargin: units.gu(13) } | 291 | anchors { left: parent.left; right: parent.right; top: analogTimer.bottom; topMargin: listPreset.dynamicTopSpacing } |
333 | 272 | 292 | ||
335 | 273 | ListItem.ThinDivider { } | 293 | ListItem.ThinDivider { id: divider } |
336 | 274 | 294 | ||
337 | 275 | ListItem.Header { | 295 | ListItem.Header { |
338 | 296 | id: locationHeader | ||
339 | 276 | Label { | 297 | Label { |
340 | 277 | text: i18n.tr("Presets") | 298 | text: i18n.tr("Presets") |
341 | 278 | anchors { verticalCenter: parent.verticalCenter; left: parent.left; leftMargin: units.gu(2) } | 299 | anchors { verticalCenter: parent.verticalCenter; left: parent.left; leftMargin: units.gu(2) } |
342 | @@ -286,7 +307,7 @@ | |||
343 | 286 | 307 | ||
344 | 287 | clip: true | 308 | clip: true |
345 | 288 | anchors { left: parent.left; right: parent.right } | 309 | anchors { left: parent.left; right: parent.right } |
347 | 289 | height: units.gu(21) | 310 | height: 5 * units.gu(6) + units.gu(1) |
348 | 290 | model: presetModel | 311 | model: presetModel |
349 | 291 | currentIndex: -1 | 312 | currentIndex: -1 |
350 | 292 | 313 | ||
351 | @@ -321,14 +342,15 @@ | |||
352 | 321 | // TODO: Implement different based actions based on the swipe direction. | 342 | // TODO: Implement different based actions based on the swipe direction. |
353 | 322 | onItemRemoved: { | 343 | onItemRemoved: { |
354 | 323 | presetModel.removePreset(index); | 344 | presetModel.removePreset(index); |
356 | 324 | timerAnimationContainer.contentY = presetModel.count != 0 ? units.gu(87) - timerPage.height : 0; | 345 | if (presetModel.count == 0) |
357 | 346 | timerAnimationContainer.contentY = tempPosition | ||
358 | 325 | } | 347 | } |
359 | 326 | 348 | ||
360 | 327 | onClicked: { | 349 | onClicked: { |
361 | 328 | if (!timerOn) { | 350 | if (!timerOn) { |
362 | 329 | analogTimer.ssToTime(seconds); | 351 | analogTimer.ssToTime(seconds); |
363 | 330 | listTimerPreset.currentIndex = index | 352 | listTimerPreset.currentIndex = index |
365 | 331 | timerAnimationContainer.contentY = 0 | 353 | timerAnimationContainer.contentY = tempPosition |
366 | 332 | namePreset.text = label; | 354 | namePreset.text = label; |
367 | 333 | tempNamePreset = label; | 355 | tempNamePreset = label; |
368 | 334 | } | 356 | } |
369 | @@ -357,7 +379,7 @@ | |||
370 | 357 | if (listTimerPreset.currentIndex == -1) { | 379 | if (listTimerPreset.currentIndex == -1) { |
371 | 358 | reset() | 380 | reset() |
372 | 359 | timerPage.state = ""; | 381 | timerPage.state = ""; |
374 | 360 | timerAnimationContainer.contentY = presetModel.count != 0 ? units.gu(87) - timerPage.height : 0; | 382 | timerAnimationContainer.contentY = tempPosition |
375 | 361 | } | 383 | } |
376 | 362 | toolbarTimer.opened = false; | 384 | toolbarTimer.opened = false; |
377 | 363 | } | 385 | } |
378 | @@ -379,7 +401,7 @@ | |||
379 | 379 | reset() | 401 | reset() |
380 | 380 | timerPage.state = ""; | 402 | timerPage.state = ""; |
381 | 381 | toolbarTimer.opened = false; | 403 | toolbarTimer.opened = false; |
383 | 382 | timerAnimationContainer.contentY = presetModel.count != 0 ? units.gu(87) - timerPage.height : 0; | 404 | timerAnimationContainer.contentY = tempPosition |
384 | 383 | } | 405 | } |
385 | 384 | } | 406 | } |
386 | 385 | } | 407 | } |
387 | 386 | 408 | ||
388 | === modified file 'ubuntu-clock-app.qml' | |||
389 | --- ubuntu-clock-app.qml 2013-09-07 19:09:03 +0000 | |||
390 | +++ ubuntu-clock-app.qml 2013-09-21 10:37:18 +0000 | |||
391 | @@ -92,12 +92,6 @@ | |||
392 | 92 | Tabs { | 92 | Tabs { |
393 | 93 | id: rootTabs | 93 | id: rootTabs |
394 | 94 | objectName: "rootTabs" | 94 | objectName: "rootTabs" |
395 | 95 | |||
396 | 96 | onSelectedTabIndexChanged: { | ||
397 | 97 | if (rootTabs.selectedTabIndex == 2) | ||
398 | 98 | timerPage.pagePostion = presetModel.count != 0 ? units.gu(87) - timerPage.height : 0; | ||
399 | 99 | } | ||
400 | 100 | |||
401 | 101 | anchors.fill: parent | 95 | anchors.fill: parent |
402 | 102 | 96 | ||
403 | 103 | Tab { | 97 | Tab { |
FAILED: Continuous integration, rev:207 91.189. 93.70:8080/ job/ubuntu- clock-app- ci/32/ 91.189. 93.70:8080/ job/generic- mediumtests/ 426 91.189. 93.70:8080/ job/ubuntu- clock-app- precise- amd64-ci/ 32 91.189. 93.70:8080/ job/ubuntu- clock-app- quantal- amd64-ci/ 32 91.189. 93.70:8080/ job/ubuntu- clock-app- raring- amd64-ci/ 32 91.189. 93.70:8080/ job/ubuntu- clock-app- saucy-amd64- ci/32
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- clock-app- ci/32/rebuild
http://