on xenial help sign in
fix issue with the shortcutoverlay getting stuck when opening the drawer
68559d2Michael Zanetti
qml/Launcher/Drawer.qml+4
@@ -38,6 +38,10 @@ FocusScope {
38 }
38 }
39 }
39 }
40
40
41+ function focusInput() {
42+ searchField.focus = true;
43+ }
44+
41 Settings {
45 Settings {
42 property alias selectedTab: sections.selectedIndex
46 property alias selectedTab: sections.selectedIndex
43 }
47 }
qml/Launcher/Launcher.qml+5−1
@@ -145,11 +145,15 @@ FocusScope {
145 switchToNextState("visible")
145 switchToNextState("visible")
146 }
146 }
147
147
148− function openDrawer() {
148+ function openDrawer(focusInputField) {
149+ panel.shortcutHintsShown = false;
149 superPressTimer.stop();
150 superPressTimer.stop();
150 superLongPressTimer.stop();
151 superLongPressTimer.stop();
151 root.focus = true;
152 root.focus = true;
152 drawer.focus = true;
153 drawer.focus = true;
154+ if (focusInputField) {
155+ drawer.focusInput();
156+ }
153 switchToNextState("drawer")
157 switchToNextState("drawer")
154 }
158 }
155
159
qml/Shell.qml+1−1
@@ -517,7 +517,7 @@ StyledItem {
517 GlobalShortcut {
517 GlobalShortcut {
518 shortcut: Qt.MetaModifier | Qt.Key_A
518 shortcut: Qt.MetaModifier | Qt.Key_A
519 onTriggered: {
519 onTriggered: {
520− launcher.openDrawer();
520+ launcher.openDrawer(true);
521 }
521 }
522 }
522 }
523 GlobalShortcut {
523 GlobalShortcut {
tests/qmltests/Launcher/tst_Drawer.qml+2
@@ -106,6 +106,7 @@ StyledItem {
106 // is true and in this case we want exactly 0 or will have pain later on
106 // is true and in this case we want exactly 0 or will have pain later on
107 tryCompareFunction( function(){ return drawer.x === 0; }, true );
107 tryCompareFunction( function(){ return drawer.x === 0; }, true );
108 tryCompare(launcher, "state", "drawer");
108 tryCompare(launcher, "state", "drawer");
109+ tryCompare(launcher, "drawerShown", true);
109 }
110 }
110
111
111 function revealByEdgePush() {
112 function revealByEdgePush() {
@@ -123,6 +124,7 @@ StyledItem {
123 // wait until it gets fully extended
124 // wait until it gets fully extended
124 tryCompare(drawer, "x", 0);
125 tryCompare(drawer, "x", 0);
125 tryCompare(launcher, "state", "drawer");
126 tryCompare(launcher, "state", "drawer");
127+ tryCompare(launcher, "drawerShown", true);
126 }
128 }
127
129
128 function init() {
130 function init() {