Merge lp:~mterry/ubuntu-system-settings/flickable-passwd-page into lp:ubuntu-system-settings

Proposed by Michael Terry
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 1059
Merged at revision: 1067
Proposed branch: lp:~mterry/ubuntu-system-settings/flickable-passwd-page
Merge into: lp:ubuntu-system-settings
Diff against target: 248 lines (+103/-91)
3 files modified
wizard/qml/Components/Page.qml (+4/-5)
wizard/qml/Pages/15-passwd.qml (+93/-85)
wizard/qml/main.qml (+6/-1)
To merge this branch: bzr merge lp:~mterry/ubuntu-system-settings/flickable-passwd-page
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Touch System Settings Pending
Review via email: mp+235117@code.launchpad.net

Commit message

Prevent the buttons of the wizard's password page from overlapping its content when the OSK appears. (LP: #1368346)

I added a Flickable to the page, so the page content can clip to the to top of the buttons. I also fixed the background image visibly moving up along with the OSK.

Description of the change

Prevent the buttons of the wizard's password page from overlapping its content when the OSK appears. (LP: #1368346)

I added a Flickable to the page, so the page content can clip to the to top of the buttons. I also fixed the background image visibly moving up along with the OSK.

I investigated a more generic solution (Flickable for all pages in the Page class), but that would involve quite an overhaul. All the content of the pages would need to be specified as Components (like the Forward button is now) in order to be able to parent them however the Page class likes. And that means nothing outside of that component can reference objects inside... It looked to be a pain. Not for this point in the cycle, I'd say

== Checklist ==

 * Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
 Yes

 * Did you build your software in a clean sbuild/pbuilder chroot or ppa?
 Just qml changes

 * Did you build your software in a clean sbuild/pbuilder armhf chroot or ppa?
 Just qml changes

 * Has your component "TestPlan” been executed successfully on emulator, N4?
 Yes

 * Has a 5 minute exploratory testing run been executed on N4?
 Yes

 * If you changed the packaging (debian), did you subscribe a core-dev to this MP?
 NA

 * If you changed the UI, did you subscribe the design-reviewers to this MP?
 Not really a design-reviewy change

 * What components might get impacted by your changes?
 Just wizard

 * Have you requested review by the teams of these owning components?
 Yes

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks, that looks fine in principle to me but for some reason I can't get the wizard to run on my krillin/rtm (even using the archive version)

"Exiting Mir! Reason: Nested Mir and Host Mir cannot use the same socket file to accept connections!"

Do you know what's wrong there?

Revision history for this message
Sebastien Bacher (seb128) wrote :

let's get that in, it looks fine and I'm sure Michael test it, right? ;-)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'wizard/qml/Components/Page.qml'
2--- wizard/qml/Components/Page.qml 2014-09-02 17:25:35 +0000
3+++ wizard/qml/Components/Page.qml 2014-09-18 13:07:42 +0000
4@@ -25,12 +25,11 @@
5 readonly property real topMargin: units.gu(8)
6 readonly property real leftMargin: units.gu(2)
7 readonly property real rightMargin: units.gu(2)
8- readonly property real bottomMargin: backButton.height + buttonMargin * 2
9
10 property bool hasBackButton: true
11 property bool customBack: false
12 property alias forwardButtonSourceComponent: forwardButton.sourceComponent
13- property alias content: contentItem
14+ property alias content: contentHolder
15
16 property string title: ""
17
18@@ -58,16 +57,16 @@
19 }
20
21 Item {
22- id: contentItem
23+ id: contentHolder
24 anchors {
25 top: titleLabel.bottom
26 left: parent.left
27 right: parent.right
28- bottom: parent.bottom
29+ bottom: backButton.top
30 topMargin: units.gu(4)
31 leftMargin: leftMargin
32 rightMargin: rightMargin
33- bottomMargin: bottomMargin
34+ bottomMargin: buttonMargin
35 }
36 }
37
38
39=== modified file 'wizard/qml/Pages/15-passwd.qml'
40--- wizard/qml/Pages/15-passwd.qml 2014-08-27 17:31:12 +0000
41+++ wizard/qml/Pages/15-passwd.qml 2014-09-18 13:07:42 +0000
42@@ -71,95 +71,103 @@
43 modemPath: manager.modems.length >= 2 ? manager.modems[1] : ""
44 }
45
46- Column {
47- id: column
48- spacing: units.gu(2)
49+ // Use a flickable for this so that we can properly clip the contents when
50+ // the OSK appears.
51+ Flickable {
52 anchors.fill: content
53-
54- ComboButton {
55- id: combo
56-
57- text: listview.currentItem.text
58- onClicked: {
59- expanded = !expanded
60- forceActiveFocus() // hides OSK if up
61- }
62- UbuntuListView {
63- id: listview
64+ clip: true
65+ contentHeight: column.height
66+ boundsBehavior: (contentHeight > height) ? Flickable.DragOverBounds : Flickable.StopAtBounds
67+
68+ Column {
69+ id: column
70+ spacing: units.gu(2)
71+
72+ ComboButton {
73+ id: combo
74+
75+ text: listview.currentItem.text
76+ onClicked: {
77+ expanded = !expanded
78+ forceActiveFocus() // hides OSK if up
79+ }
80+ UbuntuListView {
81+ id: listview
82+ width: parent.width
83+ height: combo.comboListHeight
84+ model: 3
85+ currentIndex: 1
86+ delegate: Standard {
87+ text: {
88+ var method = indexToMethod(modelData)
89+ if (method === UbuntuSecurityPrivacyPanel.Swipe)
90+ return i18n.tr("Swipe")
91+ else if (method === UbuntuSecurityPrivacyPanel.Passcode)
92+ return i18n.tr("PIN code")
93+ else
94+ return i18n.tr("Passphrase")
95+ }
96+ onClicked: {
97+ listview.currentIndex = index
98+ combo.expanded = false
99+ }
100+ }
101+ }
102+ }
103+
104+ TextField {
105+ id: passwordInput
106+ echoMode: TextInput.Password
107+ inputMethodHints: {
108+ var hints = Qt.ImhNoAutoUppercase | Qt.ImhSensitiveData
109+ if (passwdPage.method === UbuntuSecurityPrivacyPanel.Passcode)
110+ hints |= Qt.ImhDigitsOnly
111+ return hints
112+ }
113+ inputMask: {
114+ if (passwdPage.method === UbuntuSecurityPrivacyPanel.Passcode)
115+ return "9999"
116+ else
117+ return ""
118+ }
119+ visible: passwdPage.method !== UbuntuSecurityPrivacyPanel.Swipe
120+ }
121+
122+ TextField {
123+ id: confirmInput
124+ echoMode: passwordInput.echoMode
125+ inputMethodHints: passwordInput.inputMethodHints
126+ inputMask: passwordInput.inputMask
127+ visible: passwordInput.visible
128+ }
129+
130+ Label {
131+ id: problem
132 width: parent.width
133- height: combo.comboListHeight
134- model: 3
135- currentIndex: 1
136- delegate: Standard {
137- text: {
138- var method = indexToMethod(modelData)
139- if (method === UbuntuSecurityPrivacyPanel.Swipe)
140- return i18n.tr("Swipe")
141- else if (method === UbuntuSecurityPrivacyPanel.Passcode)
142- return i18n.tr("PIN code")
143- else
144- return i18n.tr("Passphrase")
145- }
146- onClicked: {
147- listview.currentIndex = index
148- combo.expanded = false
149- }
150- }
151- }
152- }
153-
154- TextField {
155- id: passwordInput
156- echoMode: TextInput.Password
157- inputMethodHints: {
158- var hints = Qt.ImhNoAutoUppercase | Qt.ImhSensitiveData
159- if (passwdPage.method === UbuntuSecurityPrivacyPanel.Passcode)
160- hints |= Qt.ImhDigitsOnly
161- return hints
162- }
163- inputMask: {
164- if (passwdPage.method === UbuntuSecurityPrivacyPanel.Passcode)
165- return "9999"
166- else
167+ wrapMode: Text.Wrap
168+ visible: text !== ""
169+ color: UbuntuColors.red
170+ text: {
171+ if (passwordInput.visible) {
172+ if (passwordInput.text !== confirmInput.text) {
173+ if (passwdPage.method === UbuntuSecurityPrivacyPanel.Passcode)
174+ return i18n.tr("Those PIN codes don't match.")
175+ else
176+ return i18n.tr("Those passphrases don't match.")
177+ } else if (passwordInput.text.length < 4) {
178+ // Note that the number four comes from PAM settings,
179+ // which we don't have a good way to interrogate. We
180+ // only do this matching instead of PAM because we want
181+ // to set the password via PAM in a different place
182+ // than this page. See comments at top of file.
183+ if (passwdPage.method === UbuntuSecurityPrivacyPanel.Passcode)
184+ return i18n.tr("PIN code must be at least four digits long.")
185+ else
186+ return i18n.tr("Passphrase must be at least four characters long.")
187+ }
188+ }
189 return ""
190- }
191- visible: passwdPage.method !== UbuntuSecurityPrivacyPanel.Swipe
192- }
193-
194- TextField {
195- id: confirmInput
196- echoMode: passwordInput.echoMode
197- inputMethodHints: passwordInput.inputMethodHints
198- inputMask: passwordInput.inputMask
199- visible: passwordInput.visible
200- }
201-
202- Label {
203- id: problem
204- width: parent.width
205- wrapMode: Text.Wrap
206- visible: text !== ""
207- color: UbuntuColors.red
208- text: {
209- if (passwordInput.visible) {
210- if (passwordInput.text !== confirmInput.text) {
211- if (passwdPage.method === UbuntuSecurityPrivacyPanel.Passcode)
212- return i18n.tr("Those PIN codes don't match.")
213- else
214- return i18n.tr("Those passphrases don't match.")
215- } else if (passwordInput.text.length < 4) {
216- // Note that the number four comes from PAM settings,
217- // which we don't have a good way to interrogate. We
218- // only do this matching instead of PAM because we want
219- // to set the password via PAM in a different place
220- // than this page. See comments at top of file.
221- if (passwdPage.method === UbuntuSecurityPrivacyPanel.Passcode)
222- return i18n.tr("PIN code must be at least four digits long.")
223- else
224- return i18n.tr("Passphrase must be at least four characters long.")
225- }
226 }
227- return ""
228 }
229 }
230 }
231
232=== modified file 'wizard/qml/main.qml'
233--- wizard/qml/main.qml 2014-09-08 19:12:35 +0000
234+++ wizard/qml/main.qml 2014-09-18 13:07:42 +0000
235@@ -82,7 +82,12 @@
236
237 Image {
238 id: image
239- anchors.fill: parent
240+ // Use x/y/height/width instead of anchors so that we don't adjust
241+ // the image when the OSK appears.
242+ x: 0
243+ y: 0
244+ height: root.height
245+ width: root.width
246 source: background.pictureUri
247 fillMode: Image.PreserveAspectCrop
248 visible: status === Image.Ready

Subscribers

People subscribed via source and target branches