on xenial help sign in
fix focus issue in launcher and drawer
commitcc805e700857d936f560f16b462866a29c25c007 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 8 Mar 2017, 17:21 (10 years ago) parent16aeee9
2 files changed+22
qml/Launcher/Launcher.qml+1 tests/qmltests/Launcher/tst_Drawer.qml+21
qml/Launcher/Launcher.qml+1
@@ -152,6 +152,7 @@ FocusScope {
152152
153153 function openForKeyboardNavigation() {
154154 panel.highlightIndex = -1; // The BFB
155+ drawer.focus = false;
155156 root.focus = true;
156157 switchToNextState("visible")
157158 }
tests/qmltests/Launcher/tst_Drawer.qml+21
@@ -311,5 +311,26 @@ StyledItem {
311311
312312 compare(launcher.lastSelectedApplication, "calendar-app");
313313 }
314+
315+ function test_focusMovesCorrectlyBetweenLauncherAndDrawer() {
316+ var panel = findChild(launcher, "launcherPanel");
317+ var drawer = findChild(launcher, "drawer");
318+ var searchField = findChild(drawer, "searchField");
319+
320+ launcher.openForKeyboardNavigation();
321+ tryCompare(panel, "highlightIndex", -1);
322+ keyClick(Qt.Key_Down);
323+ tryCompare(panel, "highlightIndex", 0);
324+
325+ launcher.openDrawer(true);
326+ tryCompare(searchField, "focus", true);
327+
328+ keyClick(Qt.Key_Escape);
329+
330+ launcher.openForKeyboardNavigation();
331+ tryCompare(panel, "highlightIndex", -1);
332+ keyClick(Qt.Key_Down);
333+ tryCompare(panel, "highlightIndex", 0);
334+ }
314335 }
315336}