Merge lp:~mikemc/ubuntuone-credentials/fix-flicking-sizing into lp:ubuntuone-credentials

Proposed by Mike McCracken
Status: Merged
Approved by: dobey
Approved revision: 61
Merged at revision: 58
Proposed branch: lp:~mikemc/ubuntuone-credentials/fix-flicking-sizing
Merge into: lp:ubuntuone-credentials
Prerequisite: lp:~mikemc/ubuntuone-credentials/faster-spinner
Diff against target: 365 lines (+112/-124)
4 files modified
online-accounts-provider/LoginForm.qml (+43/-53)
online-accounts-provider/Main.qml (+21/-12)
online-accounts-provider/NewAccount.qml (+6/-8)
online-accounts-provider/RegisterForm.qml (+42/-51)
To merge this branch: bzr merge lp:~mikemc/ubuntuone-credentials/fix-flicking-sizing
Reviewer Review Type Date Requested Status
dobey (community) Approve
Roberto Alsina (community) Approve
Review via email: mp+184355@code.launchpad.net

Commit message

- Fix flickable scrolling. Fix sizing of nested Columns in LoginForm and RegisterForm, and use correct anchors.

Description of the change

- Fix flickable scrolling. Fix sizing of nested Columns in LoginForm and RegisterForm, and use correct anchors.

NOTE: unfortunately the diff is pretty awful because the changes removed a containing object and changed a lot of indentation, and this is confusing diff, resulting in something that looks like a lot of arbitrary changes.
I suggest using bzr qdiff with the "Complete" view setting or emacs ediff or something else that shows full text side-by-side to review so it's clearer what actually happened.

TO TEST ON SAUCY desktop:
sudo apt-get build-dep ubuntuone-credentials
sudo apt-get ubuntu-system-settings
branch this , cd into it
mkdir build
cmake -DLIB_SUFFIX=/i386-linux-gnu -DCMAKE_INSTALL_PREFIX=/usr ..
sudo make install

- run /usr/bin/system-settings
- click on "accounts" then "Add account", then "Ubuntu One"
- click on 'I am a new Ubuntu One user'
- resize the window so that the buttons are not visible. (This partially simulates the keyboard being visible on the device)
- flick upward so that the view scrolls up as much as possible.
It should come to a rest with the buttons completely visible at the bottom. It should NOT bounce back so that the top is visible.

ON DEVICE:
build on device using same steps as above but use this cmake:
cmake -DLIB_SUFFIX=/arm-linux-gnueabihf/ -DCMAKE_INSTALL_PREFIX=/usr/ ..

after 'make install', run system settings from the apps lens.

- tap on "accounts" then "Add account", then "Ubuntu One"
- tap on 'I am a new Ubuntu One user'
- tap in one of the text fields to bring up the keyboard
- flick upward to reveal buttons. they should remain visible just above the keyboard.

To post a comment you must log in.
Revision history for this message
Roberto Alsina (ralsina) :
review: Approve
Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'online-accounts-provider/LoginForm.qml'
2--- online-accounts-provider/LoginForm.qml 2013-09-03 20:37:39 +0000
3+++ online-accounts-provider/LoginForm.qml 2013-09-06 17:23:31 +0000
4@@ -1,36 +1,64 @@
5 import QtQuick 2.0
6 import Ubuntu.Components 0.1
7
8-Rectangle {
9- // Set a non-zero height and width so that the parent Column in
10- // CredentialsUI lays out correctly. Set matching color so we
11- // don't see a line.
12- height: 0.001
13- width: main.width
14- color: main.parent.color
15+Column {
16+ id: loginFormColumn
17+ spacing: units.gu(2)
18
19 property alias password: passwordTextField.text
20 property alias twoFactorVisible: twoFactorUI.visible
21 property alias twoFactorCode: twoFactorTextField.text
22+
23+ Label {
24+ text: "I am a returning user and my password is:"
25+ }
26+
27+ TextField {
28+ id: passwordTextField
29+
30+ placeholderText: "Your password"
31+ echoMode: TextInput.Password
32+ width: main.width - (2 * main.anchors.margins)
33+
34+ Keys.onReturnPressed: main.processForm();
35+ }
36+
37+ Label {
38+ text: '<a href="https://login.ubuntu.com/+forgot_password"><span style="color: #dd4814;">Forgotten your password?</span></a>'
39+ textFormat: Text.RichText
40+ onLinkActivated: { Qt.openUrlExternally(link); }
41+ }
42+
43+ ButtonRow {
44+ anchors.left: parent.left
45+ anchors.right: parent.right
46+
47+ visible: !twoFactorUI.visible
48+ }
49
50 Column {
51+ id: twoFactorUI
52 spacing: units.gu(2)
53+ width: parent.width
54+ visible: false
55
56 Label {
57- text: "I am a returning user and my password is:"
58+ text: "Type your verification code:"
59 }
60+
61 TextField {
62- id: passwordTextField
63-
64- placeholderText: "Your password"
65+ id: twoFactorTextField
66+ placeholderText: "2-factor device code"
67 echoMode: TextInput.Password
68+ focus: true
69 width: main.width - (2 * main.anchors.margins)
70-
71- Keys.onReturnPressed: main.processForm();
72+ Keys.onReturnPressed: {
73+ main.processForm();
74+ }
75 }
76
77 Label {
78- text: '<a href="https://login.ubuntu.com/+forgot_password"><span style="color: #dd4814;">Forgotten your password?</span></a>'
79+ text: '<a href="https://login.ubuntu.com/+device-help"><span style="color: #dd4814;">Authentication Device Help</span></a>'
80 textFormat: Text.RichText
81 onLinkActivated: { Qt.openUrlExternally(link); }
82 }
83@@ -38,47 +66,9 @@
84 ButtonRow {
85 anchors.left: parent.left
86 anchors.right: parent.right
87-
88- visible: !twoFactorUI.visible
89 }
90
91- Column {
92- id: twoFactorUI
93- spacing: units.gu(2)
94- height: 1
95- width: parent.width
96- visible: false
97-
98- Label {
99- text: "Type your verification code:"
100- }
101-
102- TextField {
103- id: twoFactorTextField
104- placeholderText: "2-factor device code"
105- echoMode: TextInput.Password
106- focus: true
107- width: main.width - (2 * main.anchors.margins)
108- Keys.onReturnPressed: {
109- main.processForm();
110- }
111- }
112-
113- Label {
114- text: '<a href="https://login.ubuntu.com/+device-help"><span style="color: #dd4814;">Authentication Device Help</span></a>'
115- textFormat: Text.RichText
116- onLinkActivated: { Qt.openUrlExternally(link); }
117- }
118-
119- ButtonRow {
120- anchors.left: parent.left
121- anchors.right: parent.right
122- }
123-
124- } // Rectangle : twoFactorUI
125-
126-
127- }// Column
128+ }
129
130 function resetUI() {
131 twoFactorUI.visible = false;
132
133=== modified file 'online-accounts-provider/Main.qml'
134--- online-accounts-provider/Main.qml 2013-09-06 17:23:31 +0000
135+++ online-accounts-provider/Main.qml 2013-09-06 17:23:31 +0000
136@@ -20,31 +20,41 @@
137 import Ubuntu.OnlineAccounts 0.1
138
139 Flickable {
140- id: root
141+ id: rootFlickable
142+
143+ property int keyboardSize: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
144+ contentHeight: editPageLoader.item.height + keyboardSize
145
146 property url newAccountUrl: "NewAccount.qml"
147 property url existingAccountUrl: "ExistingAccount.qml"
148 property Component newAccountComponent: null
149 property Component existingAccountComponent: null
150
151- property alias source: loader.source
152-
153 signal finished
154
155- anchors.left: parent.left
156- anchors.right: parent.right
157- contentHeight: contentItem.childrenRect.height
158-
159 Loader {
160- id: loader
161+ id: editPageLoader
162 anchors.left: parent.left
163 anchors.right: parent.right
164+ anchors.top: parent.top
165 source: sourceComponent === null ? (account.accountId != 0 ? existingAccountUrl : newAccountUrl) : ""
166 sourceComponent: account.accountId != 0 ? existingAccountComponent : newAccountComponent
167
168+ onLoaded: {
169+ /* NOTE: dirty hack to work around out grandparent Page (from
170+ AccountCreationPage.qml in
171+ ubuntu-system-settings-online-accounts) not being able
172+ to find our Flickable, and not having an id set for us
173+ to set flickable directly.
174+
175+ This will not be necessary once Bug #1221845 is fixed.
176+ */
177+ rootFlickable.parent.parent.flickable = rootFlickable;
178+ }
179+
180 Connections {
181- target: loader.item
182- onFinished: root.finished()
183+ target: editPageLoader.item
184+ onFinished: rootFlickable.finished()
185 }
186 }
187
188@@ -53,8 +63,7 @@
189 opacity: 0.7
190 color: "white"
191 visible: false
192- width: parent.width
193- height: parent.height
194+ anchors.fill: parent
195
196 ActivityIndicator {
197 id: activity
198
199=== modified file 'online-accounts-provider/NewAccount.qml'
200--- online-accounts-provider/NewAccount.qml 2013-09-06 17:23:31 +0000
201+++ online-accounts-provider/NewAccount.qml 2013-09-06 17:23:31 +0000
202@@ -33,9 +33,6 @@
203
204 signal finished
205
206- anchors.top: parent.top
207- anchors.left: parent.left
208- anchors.right: parent.right
209 anchors.margins: units.gu(1)
210
211 spacing: units.gu(2)
212@@ -64,7 +61,6 @@
213 anchors.left: parent.left
214 anchors.right: parent.right
215 anchors.margins: parent.anchors.margins
216-
217 }
218
219 Label {
220@@ -88,6 +84,10 @@
221
222 Row {
223 spacing: units.gu(2)
224+ anchors.left: parent.left
225+ anchors.right: parent.right
226+ anchors.margins: parent.anchors.margins
227+
228 Switch {
229 id: newUserToggleSwitch
230 checked: false
231@@ -96,13 +96,11 @@
232 toggleNewUser();
233 }
234 }
235+
236 Label {
237 anchors.verticalCenter: newUserToggleSwitch.verticalCenter
238 text: "I am a new Ubuntu One user"
239 }
240- anchors.left: parent.left
241- anchors.right: parent.right
242- anchors.margins: parent.anchors.margins
243
244 } // Row
245
246@@ -194,7 +192,7 @@
247 interval: 0;
248 onTriggered: submitFormFromTimer();
249 }
250-
251+
252 function submitFormFromTimer() {
253 validateInput();
254 if (!formValid) {
255
256=== modified file 'online-accounts-provider/RegisterForm.qml'
257--- online-accounts-provider/RegisterForm.qml 2013-09-03 20:37:39 +0000
258+++ online-accounts-provider/RegisterForm.qml 2013-09-06 17:23:31 +0000
259@@ -1,64 +1,55 @@
260 import QtQuick 2.0
261 import Ubuntu.Components 0.1
262
263-Rectangle {
264- /* Set a non-zero height and width so that the parent Column lays out
265- correctly. Set matching color so we don't see a 1px line. */
266-
267- height: 0.001
268- width: main.width
269- color: main.parent.color
270+Column {
271+ id: registerFormColumn
272+ spacing: units.gu(2)
273
274 property alias password: passwordTextField.text
275 property alias display_name: nameTextField.text
276
277-
278- Column {
279+ Label {
280+ id: subtitle
281+ text: "Please tell us your name and choose a password."
282+ }
283+
284+ TextField {
285+ id: nameTextField
286+ placeholderText: "Your name"
287+ width: main.width - (2 * main.anchors.margins)
288+ }
289+
290+ TextField {
291+ id: passwordTextField
292+ placeholderText: "Password with at least 8 characters"
293+ echoMode: TextInput.Password
294+ width: main.width - (2 * main.anchors.margins)
295+ }
296+
297+ TextField {
298+ id: confirmPasswordTextField
299+ placeholderText: "Re-type password"
300+ echoMode: TextInput.Password
301+ width: main.width - (2 * main.anchors.margins)
302+ }
303+
304+ Row {
305 spacing: units.gu(2)
306+ CheckBox {
307+ id: termsAndConditionsCheckBox
308+ checked: false
309+ }
310
311 Label {
312- id: subtitle
313- text: "Please tell us your name and choose a password."
314- }
315-
316- TextField {
317- id: nameTextField
318- placeholderText: "Your name"
319- width: main.width - (2 * main.anchors.margins)
320- }
321-
322- TextField {
323- id: passwordTextField
324- placeholderText: "Password with at least 8 characters"
325- echoMode: TextInput.Password
326- width: main.width - (2 * main.anchors.margins)
327- }
328-
329- TextField {
330- id: confirmPasswordTextField
331- placeholderText: "Re-type password"
332- echoMode: TextInput.Password
333- width: main.width - (2 * main.anchors.margins)
334- }
335- Row {
336- spacing: units.gu(2)
337- CheckBox {
338- id: termsAndConditionsCheckBox
339- checked: false
340- }
341-
342- Label {
343- anchors.verticalCenter: termsAndConditionsCheckBox.verticalCenter
344- text: "I agree to the <a href='http://one.ubuntu.com/terms/'>Ubuntu One Terms and Conditions</a>"
345- onLinkActivated: { Qt.openUrlExternally(link); }
346- }
347- }
348-
349- ButtonRow {
350- anchors.left: parent.left
351- anchors.right: parent.right
352- }
353-
354+ anchors.verticalCenter: termsAndConditionsCheckBox.verticalCenter
355+ text: "I agree to the <a href='http://one.ubuntu.com/terms/'>Ubuntu One Terms and Conditions</a>"
356+ onLinkActivated: { Qt.openUrlExternally(link); }
357+ }
358+ }
359+
360+ ButtonRow {
361+ anchors.left: parent.left
362+ anchors.right: parent.right
363 }
364
365 function resetUI() {

Subscribers

People subscribed via source and target branches

to all changes: