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
=== modified file 'wizard/qml/Components/Page.qml'
--- wizard/qml/Components/Page.qml 2014-09-02 17:25:35 +0000
+++ wizard/qml/Components/Page.qml 2014-09-18 13:07:42 +0000
@@ -25,12 +25,11 @@
25 readonly property real topMargin: units.gu(8)25 readonly property real topMargin: units.gu(8)
26 readonly property real leftMargin: units.gu(2)26 readonly property real leftMargin: units.gu(2)
27 readonly property real rightMargin: units.gu(2)27 readonly property real rightMargin: units.gu(2)
28 readonly property real bottomMargin: backButton.height + buttonMargin * 2
2928
30 property bool hasBackButton: true29 property bool hasBackButton: true
31 property bool customBack: false30 property bool customBack: false
32 property alias forwardButtonSourceComponent: forwardButton.sourceComponent31 property alias forwardButtonSourceComponent: forwardButton.sourceComponent
33 property alias content: contentItem32 property alias content: contentHolder
3433
35 property string title: ""34 property string title: ""
3635
@@ -58,16 +57,16 @@
58 }57 }
5958
60 Item {59 Item {
61 id: contentItem60 id: contentHolder
62 anchors {61 anchors {
63 top: titleLabel.bottom62 top: titleLabel.bottom
64 left: parent.left63 left: parent.left
65 right: parent.right64 right: parent.right
66 bottom: parent.bottom65 bottom: backButton.top
67 topMargin: units.gu(4)66 topMargin: units.gu(4)
68 leftMargin: leftMargin67 leftMargin: leftMargin
69 rightMargin: rightMargin68 rightMargin: rightMargin
70 bottomMargin: bottomMargin69 bottomMargin: buttonMargin
71 }70 }
72 }71 }
7372
7473
=== modified file 'wizard/qml/Pages/15-passwd.qml'
--- wizard/qml/Pages/15-passwd.qml 2014-08-27 17:31:12 +0000
+++ wizard/qml/Pages/15-passwd.qml 2014-09-18 13:07:42 +0000
@@ -71,95 +71,103 @@
71 modemPath: manager.modems.length >= 2 ? manager.modems[1] : ""71 modemPath: manager.modems.length >= 2 ? manager.modems[1] : ""
72 }72 }
7373
74 Column {74 // Use a flickable for this so that we can properly clip the contents when
75 id: column75 // the OSK appears.
76 spacing: units.gu(2)76 Flickable {
77 anchors.fill: content77 anchors.fill: content
7878 clip: true
79 ComboButton {79 contentHeight: column.height
80 id: combo80 boundsBehavior: (contentHeight > height) ? Flickable.DragOverBounds : Flickable.StopAtBounds
8181
82 text: listview.currentItem.text82 Column {
83 onClicked: {83 id: column
84 expanded = !expanded84 spacing: units.gu(2)
85 forceActiveFocus() // hides OSK if up85
86 }86 ComboButton {
87 UbuntuListView {87 id: combo
88 id: listview88
89 text: listview.currentItem.text
90 onClicked: {
91 expanded = !expanded
92 forceActiveFocus() // hides OSK if up
93 }
94 UbuntuListView {
95 id: listview
96 width: parent.width
97 height: combo.comboListHeight
98 model: 3
99 currentIndex: 1
100 delegate: Standard {
101 text: {
102 var method = indexToMethod(modelData)
103 if (method === UbuntuSecurityPrivacyPanel.Swipe)
104 return i18n.tr("Swipe")
105 else if (method === UbuntuSecurityPrivacyPanel.Passcode)
106 return i18n.tr("PIN code")
107 else
108 return i18n.tr("Passphrase")
109 }
110 onClicked: {
111 listview.currentIndex = index
112 combo.expanded = false
113 }
114 }
115 }
116 }
117
118 TextField {
119 id: passwordInput
120 echoMode: TextInput.Password
121 inputMethodHints: {
122 var hints = Qt.ImhNoAutoUppercase | Qt.ImhSensitiveData
123 if (passwdPage.method === UbuntuSecurityPrivacyPanel.Passcode)
124 hints |= Qt.ImhDigitsOnly
125 return hints
126 }
127 inputMask: {
128 if (passwdPage.method === UbuntuSecurityPrivacyPanel.Passcode)
129 return "9999"
130 else
131 return ""
132 }
133 visible: passwdPage.method !== UbuntuSecurityPrivacyPanel.Swipe
134 }
135
136 TextField {
137 id: confirmInput
138 echoMode: passwordInput.echoMode
139 inputMethodHints: passwordInput.inputMethodHints
140 inputMask: passwordInput.inputMask
141 visible: passwordInput.visible
142 }
143
144 Label {
145 id: problem
89 width: parent.width146 width: parent.width
90 height: combo.comboListHeight147 wrapMode: Text.Wrap
91 model: 3148 visible: text !== ""
92 currentIndex: 1149 color: UbuntuColors.red
93 delegate: Standard {150 text: {
94 text: {151 if (passwordInput.visible) {
95 var method = indexToMethod(modelData)152 if (passwordInput.text !== confirmInput.text) {
96 if (method === UbuntuSecurityPrivacyPanel.Swipe)153 if (passwdPage.method === UbuntuSecurityPrivacyPanel.Passcode)
97 return i18n.tr("Swipe")154 return i18n.tr("Those PIN codes don't match.")
98 else if (method === UbuntuSecurityPrivacyPanel.Passcode)155 else
99 return i18n.tr("PIN code")156 return i18n.tr("Those passphrases don't match.")
100 else157 } else if (passwordInput.text.length < 4) {
101 return i18n.tr("Passphrase")158 // Note that the number four comes from PAM settings,
102 }159 // which we don't have a good way to interrogate. We
103 onClicked: {160 // only do this matching instead of PAM because we want
104 listview.currentIndex = index161 // to set the password via PAM in a different place
105 combo.expanded = false162 // than this page. See comments at top of file.
106 }163 if (passwdPage.method === UbuntuSecurityPrivacyPanel.Passcode)
107 }164 return i18n.tr("PIN code must be at least four digits long.")
108 }165 else
109 }166 return i18n.tr("Passphrase must be at least four characters long.")
110167 }
111 TextField {168 }
112 id: passwordInput
113 echoMode: TextInput.Password
114 inputMethodHints: {
115 var hints = Qt.ImhNoAutoUppercase | Qt.ImhSensitiveData
116 if (passwdPage.method === UbuntuSecurityPrivacyPanel.Passcode)
117 hints |= Qt.ImhDigitsOnly
118 return hints
119 }
120 inputMask: {
121 if (passwdPage.method === UbuntuSecurityPrivacyPanel.Passcode)
122 return "9999"
123 else
124 return ""169 return ""
125 }
126 visible: passwdPage.method !== UbuntuSecurityPrivacyPanel.Swipe
127 }
128
129 TextField {
130 id: confirmInput
131 echoMode: passwordInput.echoMode
132 inputMethodHints: passwordInput.inputMethodHints
133 inputMask: passwordInput.inputMask
134 visible: passwordInput.visible
135 }
136
137 Label {
138 id: problem
139 width: parent.width
140 wrapMode: Text.Wrap
141 visible: text !== ""
142 color: UbuntuColors.red
143 text: {
144 if (passwordInput.visible) {
145 if (passwordInput.text !== confirmInput.text) {
146 if (passwdPage.method === UbuntuSecurityPrivacyPanel.Passcode)
147 return i18n.tr("Those PIN codes don't match.")
148 else
149 return i18n.tr("Those passphrases don't match.")
150 } else if (passwordInput.text.length < 4) {
151 // Note that the number four comes from PAM settings,
152 // which we don't have a good way to interrogate. We
153 // only do this matching instead of PAM because we want
154 // to set the password via PAM in a different place
155 // than this page. See comments at top of file.
156 if (passwdPage.method === UbuntuSecurityPrivacyPanel.Passcode)
157 return i18n.tr("PIN code must be at least four digits long.")
158 else
159 return i18n.tr("Passphrase must be at least four characters long.")
160 }
161 }170 }
162 return ""
163 }171 }
164 }172 }
165 }173 }
166174
=== modified file 'wizard/qml/main.qml'
--- wizard/qml/main.qml 2014-09-08 19:12:35 +0000
+++ wizard/qml/main.qml 2014-09-18 13:07:42 +0000
@@ -82,7 +82,12 @@
8282
83 Image {83 Image {
84 id: image84 id: image
85 anchors.fill: parent85 // Use x/y/height/width instead of anchors so that we don't adjust
86 // the image when the OSK appears.
87 x: 0
88 y: 0
89 height: root.height
90 width: root.width
86 source: background.pictureUri91 source: background.pictureUri
87 fillMode: Image.PreserveAspectCrop92 fillMode: Image.PreserveAspectCrop
88 visible: status === Image.Ready93 visible: status === Image.Ready

Subscribers

People subscribed via source and target branches