on xenial help sign in
Fix keyboard nav issues
commit8aaabf69c31499babb25078f9bed77c3fed384a5 authorJosh Arenson <joshua.arenson@canonical.com> dateTue 13 Sep 2016, 16:07 (10 years ago) parentd7533e0
3 files changed+21−8
qml/Greeter/Greeter.qml−2 qml/Greeter/GreeterPrompt.qml+19−2 qml/Greeter/LoginList.qml+2−4
qml/Greeter/Greeter.qml−2
@@ -212,7 +212,6 @@ Showable {
212212 }
213213
214214 function login() {
215− console.log("JOSH-> Entering Greeter::login()")
216215 d.waiting = true;
217216 if (LightDMService.greeter.startSessionSync(root.sessionToStart())) {
218217 sessionStarted();
@@ -365,7 +364,6 @@ Showable {
365364 d.selectUser(index, true);
366365 }
367366 onResponded: {
368− console.log("JOSH-> Greeter:onResponded handler called ->" + root.locked)
369367 if (root.locked) {
370368 LightDMService.greeter.respond(response);
371369 } else {
qml/Greeter/GreeterPrompt.qml+19−2
@@ -70,19 +70,36 @@ FocusScope {
7070 }
7171 }
7272
73− AbstractButton {
73+ Rectangle {
7474 id: promptButton
7575 objectName: "promptButton"
7676 anchors.fill: parent
7777 visible: !root.isPrompt
7878
79− onClicked: {
79+ function triggered() {
8080 if (d.enabled) {
8181 d.enabled = false;
8282 root.clicked();
8383 }
8484 }
8585
86+ Rectangle {
87+ height: parent.height;
88+ width: parent.width
89+ color: "transparent"
90+ border {
91+ color: "grey"
92+ width: units.dp(1)
93+ }
94+ }
95+
96+ Keys.onReturnPressed: triggered();
97+ Keys.onEnterPressed: triggered();
98+ MouseArea {
99+ anchors.fill: parent
100+ onClicked: parent.triggered();
101+ }
102+
86103 Label {
87104 anchors.centerIn: parent
88105 color: d.textColor
qml/Greeter/LoginList.qml+2−4
@@ -88,7 +88,6 @@ StyledItem {
8888 id: d
8989
9090 function checkIfPromptless() {
91− console.log("JOSH-> Entering LoginList:checkIfPromptless(): " + waiting + " : " + wasPrompted);
9291 if (!waiting && !wasPrompted) {
9392 passwordInput.isPrompt = false;
9493 passwordInput.text = root.locked ? i18n.tr("Retry")
@@ -104,7 +103,6 @@ StyledItem {
104103 name: "Ubuntu.Components.Themes.Ambiance"
105104 }
106105
107− KeyNavigation.tab: sessionChooser
108106 Keys.onUpPressed: {
109107 selected(currentIndex - 1);
110108 event.accepted = true;
@@ -162,7 +160,6 @@ StyledItem {
162160 moveTimer.start();
163161 }
164162
165− onCurrentItemChanged: console.log("JOSH-> LoginList currentItem.height = " + currentItem.height);
166163 delegate: Item {
167164 width: parent.width
168165 height: root.cellHeight
@@ -247,6 +244,7 @@ StyledItem {
247244 height: units.gu(3.5)
248245 width: units.gu(3.5)
249246
247+ activeFocusOnTab: true
250248 anchors {
251249 right: highlightItem.right
252250 rightMargin: units.gu(2)
@@ -275,7 +273,6 @@ StyledItem {
275273 source: LightDMService.sessions.iconUrl(root.currentSession)
276274 }
277275
278− KeyNavigation.tab: passwordInput
279276 Keys.onReturnPressed: {
280277 sessionChooserButtonClicked();
281278 event.accepted = true;
@@ -329,6 +326,7 @@ StyledItem {
329326 width: highlightItem.width - anchors.margins * 2
330327 opacity: userList.movingInternally ? 0 : 1
331328
329+ activeFocusOnTab: true
332330 isAlphanumeric: root.alphanumeric
333331
334332 onClicked: root.tryToUnlock()