on xenial help sign in
fix layout
18c638eLukáš Tinkl
qml/Wizard/Pages/passcode-desktop.qml+15−5
@@ -15,6 +15,7 @@
15 */
15 */
16
16
17import QtQuick 2.4
17import QtQuick 2.4
18+import QtQuick.Layouts 1.1
18import Ubuntu.Components 1.3
19import Ubuntu.Components 1.3
19import ".." as LocalComponents
20import ".." as LocalComponents
20
21
@@ -31,13 +32,15 @@ LocalComponents.Page {
31
32
32 property alias password: passwordField.text
33 property alias password: passwordField.text
33
34
34− Column {
35+ GridLayout {
35 id: column
36 id: column
37+ columns: 1
38+ rows: 3
36 anchors.fill: content
39 anchors.fill: content
37 anchors.leftMargin: leftMargin
40 anchors.leftMargin: leftMargin
38 anchors.rightMargin: rightMargin
41 anchors.rightMargin: rightMargin
39 anchors.topMargin: customMargin
42 anchors.topMargin: customMargin
40− spacing: units.gu(3)
43+ rowSpacing: units.gu(3)
41
44
42 Label {
45 Label {
43 id: infoLabel
46 id: infoLabel
@@ -52,22 +55,24 @@ LocalComponents.Page {
52 text: i18n.tr("Enter 4 numbers to setup your passcode")
55 text: i18n.tr("Enter 4 numbers to setup your passcode")
53 }
56 }
54
57
55− Grid {
58+ GridLayout {
56 columns: 2
59 columns: 2
57− spacing: units.gu(2)
60+ columnSpacing: units.gu(2)
58− verticalItemAlignment: Grid.AlignVCenter
61+ rowSpacing: units.gu(2)
59
62
60 Label {
63 Label {
61 text: i18n.tr("Choose passcode")
64 text: i18n.tr("Choose passcode")
62 color: textColor
65 color: textColor
63 }
66 }
64 LocalComponents.WizardTextField {
67 LocalComponents.WizardTextField {
68+ Layout.fillWidth: true
65 id: passwordField
69 id: passwordField
66 objectName: "passwordField"
70 objectName: "passwordField"
67 echoMode: TextInput.Password
71 echoMode: TextInput.Password
68 inputMethodHints: Qt.ImhDigitsOnly
72 inputMethodHints: Qt.ImhDigitsOnly
69 validator: RegExpValidator { regExp: /^\d{4}$/ }
73 validator: RegExpValidator { regExp: /^\d{4}$/ }
70 maximumLength: 4
74 maximumLength: 4
75+ onAccepted: password2Field.forceActiveFocus()
71 }
76 }
72
77
73 Label {
78 Label {
@@ -75,6 +80,7 @@ LocalComponents.Page {
75 color: textColor
80 color: textColor
76 }
81 }
77 LocalComponents.WizardTextField {
82 LocalComponents.WizardTextField {
83+ Layout.fillWidth: true
78 id: password2Field
84 id: password2Field
79 objectName: "password2Field"
85 objectName: "password2Field"
80 echoMode: TextInput.Password
86 echoMode: TextInput.Password
@@ -83,6 +89,10 @@ LocalComponents.Page {
83 maximumLength: 4
89 maximumLength: 4
84 }
90 }
85 }
91 }
92+
93+ Item { // spacer
94+ Layout.fillHeight: true
95+ }
86 }
96 }
87
97
88 Component {
98 Component {