@@ -19,6 +19,7 @@ import Ubuntu.Components 1.3
1919import Ubuntu.Web 0.2
2020import AccountsService 0.1
2121import ".." as LocalComponents
22+import "../../Components"
2223
2324LocalComponents.Page {
2425 objectName: "accountPage"
@@ -30,6 +31,20 @@ LocalComponents.Page {
3031 theme.palette.normal.backgroundText = "#cdcdcd";
3132 }
3233
34+ QtObject {
35+ id: d
36+
37+ readonly property bool validInput: /*emailInput.acceptableInput && */nameInput.text !== "" &&
38+ pass2Input.text.length > 7 && passInput.text === pass2Input.text
39+
40+ function advance() {
41+ root.password = passInput.text;
42+ AccountsService.realName = nameInput.text;
43+ //AccountsService.email = emailInput.text;
44+ pageStack.next();
45+ }
46+ }
47+
3348 Flickable
3449 {
3550 id: column
@@ -40,6 +55,11 @@ LocalComponents.Page {
4055 anchors.rightMargin: parent.rightMargin
4156 anchors.topMargin: customMargin
4257
58+ ListViewOSKScroller {
59+ id: oskScroller
60+ list: column
61+ }
62+
4363// // email
4464// Label {
4565// id: emailLabel
@@ -97,6 +117,9 @@ LocalComponents.Page {
97117 anchors.top: nameLabel.bottom
98118 anchors.topMargin: units.gu(1)
99119 KeyNavigation.tab: passInput
120+ onActiveFocusChanged: if (activeFocus) oskScroller.setMakeSureVisibleItem(nameInput)
121+ inputMethodHints: Qt.ImhNoAutoUppercase
122+ onAccepted: passInput.forceActiveFocus()
100123 }
101124
102125 // password
@@ -120,6 +143,8 @@ LocalComponents.Page {
120143 echoMode: TextInput.Password
121144 placeholderText: i18n.tr("Use a combination of letters and numbers")
122145 KeyNavigation.tab: pass2Input
146+ onActiveFocusChanged: if (activeFocus) oskScroller.setMakeSureVisibleItem(passInput)
147+ onAccepted: pass2Input.forceActiveFocus()
123148 }
124149
125150 // password meter
@@ -153,20 +178,18 @@ LocalComponents.Page {
153178 anchors.topMargin: units.gu(1)
154179 echoMode: TextInput.Password
155180 KeyNavigation.tab: nameInput
181+ onActiveFocusChanged: if (activeFocus) oskScroller.setMakeSureVisibleItem(pass2Input)
182+ onAccepted: if (d.validInput) d.advance();
156183 }
157184 }
158185
159186 Component {
160187 id: forwardButton
161188 LocalComponents.StackButton {
162− enabled: /*emailInput.acceptableInput && */nameInput.text !== "" &&
163− pass2Input.text.length > 7 && passInput.text === pass2Input.text
189+ enabled: d.validInput
164190 text: i18n.tr("Next")
165191 onClicked: {
166− root.password = passInput.text;
167− AccountsService.realName = nameInput.text;
168− //AccountsService.email = emailInput.text;
169− pageStack.next();
192+ d.advance();
170193 }
171194 }
172195 }