on xenial help sign in
Fix some smaller issues with OOBE wizard password pages (LP: #1590467)
314455fLukáš Tinkl
qml/Wizard/Pages/passcode-desktop.qml+27−10
@@ -33,15 +33,18 @@ LocalComponents.Page {
33 readonly property alias password: passwordField.text
33 readonly property alias password: passwordField.text
34 readonly property alias password2: password2Field.text
34 readonly property alias password2: password2Field.text
35
35
36− GridLayout {
36+ Flickable {
37 id: column
37 id: column
38− columns: 1
38+ clip: true
39− rows: 3
39+ flickableDirection: Flickable.VerticalFlick
40 anchors.fill: content
40 anchors.fill: content
41− anchors.leftMargin: leftMargin
41+ anchors.leftMargin: parent.leftMargin
42− anchors.rightMargin: rightMargin
42+ anchors.rightMargin: parent.rightMargin
43 anchors.topMargin: customMargin
43 anchors.topMargin: customMargin
44− rowSpacing: units.gu(3)
44+
45+ bottomMargin: Qt.inputMethod.keyboardRectangle.height - height - customMargin
46+
47+ Behavior on contentY { UbuntuNumberAnimation {} }
45
48
46 Label {
49 Label {
47 id: infoLabel
50 id: infoLabel
@@ -49,6 +52,7 @@ LocalComponents.Page {
49 anchors {
52 anchors {
50 left: parent.left
53 left: parent.left
51 right: parent.right
54 right: parent.right
55+ top: parent.top
52 }
56 }
53 wrapMode: Text.Wrap
57 wrapMode: Text.Wrap
54 font.weight: Font.Light
58 font.weight: Font.Light
@@ -57,6 +61,13 @@ LocalComponents.Page {
57 }
61 }
58
62
59 GridLayout {
63 GridLayout {
64+ anchors {
65+ left: parent.left
66+ right: parent.right
67+ top: infoLabel.bottom
68+ topMargin: units.gu(3)
69+ }
70+
60 columns: 2
71 columns: 2
61 columnSpacing: units.gu(2)
72 columnSpacing: units.gu(2)
62 rowSpacing: units.gu(2)
73 rowSpacing: units.gu(2)
@@ -74,6 +85,11 @@ LocalComponents.Page {
74 validator: RegExpValidator { regExp: /^\d{4}$/ }
85 validator: RegExpValidator { regExp: /^\d{4}$/ }
75 maximumLength: 4
86 maximumLength: 4
76 onAccepted: password2Field.forceActiveFocus()
87 onAccepted: password2Field.forceActiveFocus()
88+ onActiveFocusChanged: {
89+ if (activeFocus) {
90+ column.contentY = y
91+ }
92+ }
77 }
93 }
78
94
79 Label {
95 Label {
@@ -88,6 +104,11 @@ LocalComponents.Page {
88 inputMethodHints: Qt.ImhDigitsOnly
104 inputMethodHints: Qt.ImhDigitsOnly
89 validator: RegExpValidator { regExp: /^\d{4}$/ }
105 validator: RegExpValidator { regExp: /^\d{4}$/ }
90 maximumLength: 4
106 maximumLength: 4
107+ onActiveFocusChanged: {
108+ if (activeFocus) {
109+ column.contentY = y
110+ }
111+ }
91 }
112 }
92
113
93 Label {
114 Label {
@@ -112,10 +133,6 @@ LocalComponents.Page {
112 }
133 }
113 }
134 }
114 }
135 }
115−
116− Item { // spacer
117− Layout.fillHeight: true
118− }
119 }
136 }
120
137
121 Component {
138 Component {
qml/Wizard/PasswordMeter.qml+3−1
@@ -83,7 +83,9 @@ Item {
83 wrapMode: Text.Wrap
83 wrapMode: Text.Wrap
84 text: {
84 text: {
85 if (matching !== undefined) {
85 if (matching !== undefined) {
86+ if (password.length < 8)
87+ return i18n.tr("Password too short");
86− if (matching)
88+ else if (matching)
87 return i18n.tr("Passwords match");
89 return i18n.tr("Passwords match");
88 else if (!matching)
90 else if (!matching)
89 return i18n.tr("Passwords do not match");
91 return i18n.tr("Passwords do not match");