on xenial help sign in
try harder not to get covered by OSK
commit33fa90d87042f99ddac15e5303a7fcb3e99ffa5b authorLukáš Tinkl <lukas.tinkl@canonical.com> dateSat 28 Nov 2015, 01:56 (11 years ago) parentd0fa5d7
3 files changed+30−42
qml/Wizard/Page.qml+5−3 qml/Wizard/Pages/60-account.qml+24−39 qml/Wizard/Pages/80-finished.qml+1
qml/Wizard/Page.qml+5−3
@@ -24,6 +24,7 @@ Item {
2424 readonly property real buttonWidth: (width - buttonMargin * 2) / 2 -
2525 buttonMargin / 2
2626 readonly property real buttonBarHeight: units.gu(5)
27+ readonly property real titleRectHeight: customTitle ? units.gu(10) : units.gu(16)
2728
2829 readonly property real topMargin: units.gu(11)
2930 readonly property real bottomMargin: units.gu(3)
@@ -118,7 +119,7 @@ Item {
118119 right: parent.right
119120 }
120121 source: customTitle ? "" : "Pages/data/Phone header bkg.png"
121− height: customTitle ? units.gu(10) : units.gu(16)
122+ height: titleRectHeight
122123 clip: true
123124
124125 // page title
@@ -211,9 +212,10 @@ Item {
211212 // button bar
212213 Rectangle {
213214 id: buttonRect
214− visible: !lastPage && buttonBarVisible
215+ visible: buttonBarVisible
215216 anchors {
216− bottom: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.top : parent.bottom
217+ bottom: parent.bottom
218+ bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
217219 left: parent.left
218220 right: parent.right
219221 }
qml/Wizard/Pages/60-account.qml+24−39
@@ -19,7 +19,6 @@ import Ubuntu.Components 1.3
1919import Ubuntu.Web 0.2
2020import AccountsService 0.1
2121import ".." as LocalComponents
22−import "../../Components"
2322
2423LocalComponents.Page {
2524 objectName: "accountPage"
@@ -34,13 +33,12 @@ LocalComponents.Page {
3433 QtObject {
3534 id: d
3635
37− readonly property bool validInput: /*emailInput.acceptableInput && */nameInput.text !== "" &&
36+ readonly property bool validInput: nameInput.text !== "" &&
3837 pass2Input.text.length > 7 && passInput.text === pass2Input.text
3938
4039 function advance() {
4140 root.password = passInput.text;
4241 AccountsService.realName = nameInput.text;
43− //AccountsService.email = emailInput.text;
4442 pageStack.next();
4543 }
4644 }
@@ -54,35 +52,8 @@ LocalComponents.Page {
5452 anchors.leftMargin: parent.leftMargin
5553 anchors.rightMargin: parent.rightMargin
5654 anchors.topMargin: customMargin
57−
58− ListViewOSKScroller {
59− id: oskScroller
60− list: column
61− }
62−
63−// // email
64−// Label {
65−// id: emailLabel
66−// anchors.left: parent.left
67−// anchors.right: parent.right
68−// wrapMode: Text.Wrap
69−// text: i18n.tr("Email")
70−// color: textColor
71−// font.weight: Font.Light
72−// }
73−
74−// LocalComponents.WizardTextField {
75−// id: emailInput
76−// anchors.left: parent.left
77−// anchors.right: parent.right
78−// anchors.top: emailLabel.bottom
79−// anchors.topMargin: units.gu(1)
80−// inputMethodHints: Qt.ImhEmailCharactersOnly
81−// validator: RegExpValidator {
82−// regExp: /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i
83−// }
84−// KeyNavigation.tab: nameInput
85−// }
55+ height: contentHeight - buttonBarHeight - (Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0) - titleRectHeight
56+ contentHeight: contentItem.childrenRect.height
8657
8758 // notice
8859 Label {
@@ -116,9 +87,13 @@ LocalComponents.Page {
11687 anchors.right: parent.right
11788 anchors.top: nameLabel.bottom
11889 anchors.topMargin: units.gu(1)
119− KeyNavigation.tab: passInput
120− onActiveFocusChanged: if (activeFocus) oskScroller.setMakeSureVisibleItem(nameInput)
121− inputMethodHints: Qt.ImhNoAutoUppercase
90+ onActiveFocusChanged: {
91+ if (activeFocus) {
92+ print("Name got focused", focus);
93+ column.contentY = nameLabel.y
94+ }
95+ }
96+ inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
12297 onAccepted: passInput.forceActiveFocus()
12398 }
12499
@@ -142,8 +117,13 @@ LocalComponents.Page {
142117 anchors.topMargin: units.gu(1)
143118 echoMode: TextInput.Password
144119 placeholderText: i18n.tr("Use a combination of letters and numbers")
145− KeyNavigation.tab: pass2Input
146− onActiveFocusChanged: if (activeFocus) oskScroller.setMakeSureVisibleItem(passInput)
120+ inputMethodHints: Qt.ImhNoPredictiveText
121+ onActiveFocusChanged: {
122+ if (activeFocus) {
123+ print("Password got focused", focus);
124+ column.contentY = passLabel.y
125+ }
126+ }
147127 onAccepted: pass2Input.forceActiveFocus()
148128 }
149129
@@ -177,8 +157,13 @@ LocalComponents.Page {
177157 anchors.top: pass2Label.bottom
178158 anchors.topMargin: units.gu(1)
179159 echoMode: TextInput.Password
180− KeyNavigation.tab: nameInput
181− onActiveFocusChanged: if (activeFocus) oskScroller.setMakeSureVisibleItem(pass2Input)
160+ inputMethodHints: Qt.ImhNoPredictiveText
161+ onActiveFocusChanged: {
162+ if (activeFocus) {
163+ print("Password 2 got focused", focus);
164+ column.contentY = pass2Label.y
165+ }
166+ }
182167 onAccepted: if (d.validInput) d.advance();
183168 }
184169 }
qml/Wizard/Pages/80-finished.qml+1
@@ -24,6 +24,7 @@ LocalComponents.Page {
2424 hasBackButton: false
2525 customTitle: true
2626 lastPage: true
27+ buttonBarVisible: false
2728
2829 Component.onCompleted: {
2930 state = "reanchored";