on xenial help sign in
reworked the Account page
commit3370734c92d218347929d0321882bd85828c81e3 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateFri 12 Feb 2016, 13:38 (11 years ago) parent05a36be
1 file changed+29−104
qml/Wizard/Pages/60-account.qml+29−104
qml/Wizard/Pages/60-account.qml+29−104
@@ -21,7 +21,7 @@ import ".." as LocalComponents
2121
2222LocalComponents.Page {
2323 objectName: "accountPage"
24− title: i18n.tr("User Details")
24+ title: i18n.tr("Personalize Your Device")
2525
2626 forwardButtonSourceComponent: forwardButton
2727
@@ -32,12 +32,12 @@ LocalComponents.Page {
3232 QtObject {
3333 id: d
3434
35− readonly property bool validInput: true //nameInput.text !== ""
36− // && pass2Input.text.length > 7 && passInput.text === pass2Input.text
37−
3835 function advance() {
39− //root.password = passInput.text;
40− AccountsService.realName = nameInput.text;
36+ var tmp = nameInput.text + " " + surnameInput.text;
37+ var realName = tmp.trim();
38+ if (realName !== "") {
39+ AccountsService.realName = realName;
40+ }
4141 pageStack.next();
4242 }
4343 }
@@ -50,132 +50,57 @@ LocalComponents.Page {
5050 anchors.leftMargin: parent.leftMargin
5151 anchors.rightMargin: parent.rightMargin
5252 anchors.topMargin: customMargin
53− height: contentHeight - buttonBarHeight - (Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0) - titleRectHeight
54− contentHeight: contentItem.childrenRect.height
55−
56− Behavior on contentY { UbuntuNumberAnimation{} }
5753
58− // notice
54+ // name
5955 Label {
60− id: noticeLabel
56+ id: nameLabel
6157 anchors.left: parent.left
6258 anchors.right: parent.right
63− wrapMode: Text.Wrap
64− text: i18n.tr("Lorem ipsum dolor sit amet, consectetuer adipiscing elit.")
59+ text: i18n.tr("Your Name")
6560 color: textColor
66− fontSize: "small"
6761 font.weight: Font.Light
68− lineHeight: 1.2
69− width: content.width
7062 }
7163
72− // username
64+ LocalComponents.WizardTextField {
65+ id: nameInput
66+ objectName: "nameInput"
67+ anchors.left: parent.left
68+ anchors.right: parent.right
69+ anchors.top: nameLabel.bottom
70+ anchors.topMargin: units.gu(1)
71+ inputMethodHints: Qt.ImhNoPredictiveText
72+ onAccepted: surnameInput.forceActiveFocus()
73+ }
74+
75+ // surname
7376 Label {
74− id: nameLabel
77+ id: surnameLabel
7578 anchors.left: parent.left
7679 anchors.right: parent.right
77− anchors.top: noticeLabel.bottom
80+ anchors.top: nameInput.bottom
7881 anchors.topMargin: units.gu(3)
79− text: i18n.tr("Your name")
82+ text: i18n.tr("Your Surname")
8083 color: textColor
8184 font.weight: Font.Light
8285 }
8386
8487 LocalComponents.WizardTextField {
85− id: nameInput
86− objectName: "nameInput"
88+ id: surnameInput
89+ objectName: "surnameInput"
8790 anchors.left: parent.left
8891 anchors.right: parent.right
89− anchors.top: nameLabel.bottom
92+ anchors.top: surnameLabel.bottom
9093 anchors.topMargin: units.gu(1)
91−// onActiveFocusChanged: {
92−// if (activeFocus) {
93−// column.contentY = nameLabel.y
94−// }
95−// }
9694 inputMethodHints: Qt.ImhNoPredictiveText
97− //onAccepted: passInput.forceActiveFocus()
95+ onAccepted: d.advance()
9896 }
99−
100−// // password
101−// Label {
102−// id: passLabel
103−// anchors.left: parent.left
104−// anchors.right: parent.right
105−// anchors.top: nameInput.bottom
106−// anchors.topMargin: units.gu(2)
107−// text: i18n.tr("Password")
108−// color: textColor
109−// font.weight: Font.Light
110−// }
111−
112−// LocalComponents.WizardTextField {
113−// id: passInput
114−// objectName: "passInput"
115−// anchors.left: parent.left
116−// anchors.right: parent.right
117−// anchors.top: passLabel.bottom
118−// anchors.topMargin: units.gu(1)
119−// echoMode: TextInput.Password
120−// placeholderText: i18n.tr("Use letters and numbers")
121−// inputMethodHints: Qt.ImhNoPredictiveText
122−// onActiveFocusChanged: {
123−// if (activeFocus) {
124−// column.contentY = passLabel.y
125−// }
126−// }
127−// onAccepted: pass2Input.forceActiveFocus()
128−// }
129−
130−// // password meter
131−// LocalComponents.PasswordMeter {
132−// id: passMeter
133−// anchors.left: parent.left
134−// anchors.right: parent.right
135−// anchors.top: passInput.bottom
136−// anchors.topMargin: units.gu(1)
137−// password: passInput.text
138−// }
139−
140−// // repeat password
141−// Label {
142−// id: pass2Label
143−// anchors.left: parent.left
144−// anchors.right: parent.right
145−// anchors.top: passMeter.bottom
146−// anchors.topMargin: passInput.text !== "" ? units.gu(4) : units.gu(2)
147−// wrapMode: Text.Wrap
148−// text: i18n.tr("Repeat password")
149−// color: textColor
150−// font.weight: Font.Light
151−// }
152−
153−// LocalComponents.WizardTextField {
154−// id: pass2Input
155−// objectName: "pass2Input"
156−// anchors.left: parent.left
157−// anchors.right: parent.right
158−// anchors.top: pass2Label.bottom
159−// anchors.topMargin: units.gu(1)
160−// echoMode: TextInput.Password
161−// inputMethodHints: Qt.ImhNoPredictiveText
162−// onActiveFocusChanged: {
163−// if (activeFocus) {
164−// column.contentY = pass2Label.y
165−// }
166−// }
167−// onAccepted: if (d.validInput) d.advance();
168−// }
16997 }
17098
17199 Component {
172100 id: forwardButton
173101 LocalComponents.StackButton {
174− enabled: d.validInput
175102 text: i18n.tr("Next")
176− onClicked: {
177− d.advance();
178− }
103+ onClicked: d.advance();
179104 }
180105 }
181106}