on xenial help sign in
fix issue with the shortcutoverlay getting stuck when opening the drawer
commit68559d261d948ac6146b1db8b9cbfe0010eec8c7 authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 18 Nov 2016, 13:25 (10 years ago) parentf3616b9
4 files changed+12−2
qml/Launcher/Drawer.qml+4 qml/Launcher/Launcher.qml+5−1 qml/Shell.qml+1−1 tests/qmltests/Launcher/tst_Drawer.qml+2
qml/Launcher/Drawer.qml+4
@@ -38,6 +38,10 @@ FocusScope {
3838 }
3939 }
4040
41+ function focusInput() {
42+ searchField.focus = true;
43+ }
44+
4145 Settings {
4246 property alias selectedTab: sections.selectedIndex
4347 }
qml/Launcher/Launcher.qml+5−1
@@ -145,11 +145,15 @@ FocusScope {
145145 switchToNextState("visible")
146146 }
147147
148− function openDrawer() {
148+ function openDrawer(focusInputField) {
149+ panel.shortcutHintsShown = false;
149150 superPressTimer.stop();
150151 superLongPressTimer.stop();
151152 root.focus = true;
152153 drawer.focus = true;
154+ if (focusInputField) {
155+ drawer.focusInput();
156+ }
153157 switchToNextState("drawer")
154158 }
155159
qml/Shell.qml+1−1
@@ -517,7 +517,7 @@ StyledItem {
517517 GlobalShortcut {
518518 shortcut: Qt.MetaModifier | Qt.Key_A
519519 onTriggered: {
520− launcher.openDrawer();
520+ launcher.openDrawer(true);
521521 }
522522 }
523523 GlobalShortcut {
tests/qmltests/Launcher/tst_Drawer.qml+2
@@ -106,6 +106,7 @@ StyledItem {
106106 // is true and in this case we want exactly 0 or will have pain later on
107107 tryCompareFunction( function(){ return drawer.x === 0; }, true );
108108 tryCompare(launcher, "state", "drawer");
109+ tryCompare(launcher, "drawerShown", true);
109110 }
110111
111112 function revealByEdgePush() {
@@ -123,6 +124,7 @@ StyledItem {
123124 // wait until it gets fully extended
124125 tryCompare(drawer, "x", 0);
125126 tryCompare(launcher, "state", "drawer");
127+ tryCompare(launcher, "drawerShown", true);
126128 }
127129
128130 function init() {