on xenial help sign in
fix the focus moving correctly between launcher and drawer (LP: #1669880)

Approved by: Albert Astals Cid, Unity8 CI Bot

commit7645501a7bdeac064b3b499e983e1e21d1c42855 authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 21 Mar 2017, 10:54 (10 years ago) parentfe7f3cfd323b7b
2 files changed+22
qml/Launcher/Launcher.qml+1 tests/qmltests/Launcher/tst_Drawer.qml+21
qml/Launcher/Launcher.qml+1
@@ -163,6 +163,7 @@ FocusScope {
163163
164164 function openForKeyboardNavigation() {
165165 panel.highlightIndex = -1; // The BFB
166+ drawer.focus = false;
166167 root.focus = true;
167168 switchToNextState("visible")
168169 }
tests/qmltests/Launcher/tst_Drawer.qml+21
@@ -329,6 +329,27 @@ StyledItem {
329329 tryCompare(launcher, "state", "visibleTemporary");
330330 }
331331
332+ function test_focusMovesCorrectlyBetweenLauncherAndDrawer() {
333+ var panel = findChild(launcher, "launcherPanel");
334+ var drawer = findChild(launcher, "drawer");
335+ var searchField = findChild(drawer, "searchField");
336+
337+ launcher.openForKeyboardNavigation();
338+ tryCompare(panel, "highlightIndex", -1);
339+ keyClick(Qt.Key_Down);
340+ tryCompare(panel, "highlightIndex", 0);
341+
342+ launcher.openDrawer(true);
343+ tryCompare(searchField, "focus", true);
344+
345+ keyClick(Qt.Key_Escape);
346+
347+ launcher.openForKeyboardNavigation();
348+ tryCompare(panel, "highlightIndex", -1);
349+ keyClick(Qt.Key_Down);
350+ tryCompare(panel, "highlightIndex", 0);
351+ }
352+
332353 function test_closeWhileDragging() {
333354 launcher.openDrawer(true);
334355 waitForRendering(launcher);