on xenial help sign in
disable the launcher on the greeter
commit89f4fc0b41d6a5cc00656cdefab560289ac36f20 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 24 Nov 2016, 16:17 (10 years ago) parent55c26c2
3 files changed+31−3
qml/Launcher/Launcher.qml+12−3 qml/Shell.qml+1 tests/qmltests/Launcher/tst_Drawer.qml+18
qml/Launcher/Launcher.qml+12−3
@@ -29,6 +29,7 @@ FocusScope {
2929 property alias inverted: panel.inverted
3030 property Item blurSource: null
3131 property int topPanelHeight: 0
32+ property bool drawerEnabled: true
3233
3334 property int panelWidth: units.gu(10)
3435 property int dragAreaWidth: units.gu(1)
@@ -146,6 +147,10 @@ FocusScope {
146147 }
147148
148149 function openDrawer(focusInputField) {
150+ if (!drawerEnabled) {
151+ return;
152+ }
153+
149154 panel.shortcutHintsShown = false;
150155 superPressTimer.stop();
151156 superLongPressTimer.stop();
@@ -456,7 +461,11 @@ FocusScope {
456461 root.switchToNextState("visibleTemporary");
457462 }
458463 }
459− onPassed: { root.switchToNextState("drawer"); }
464+ onPassed: {
465+ if (root.drawerEnabled) {
466+ root.switchToNextState("drawer");
467+ }
468+ }
460469
461470 material: Component {
462471 Item {
@@ -492,7 +501,7 @@ FocusScope {
492501 panel.x = -panel.width + Math.min(Math.max(0, distance), panel.width);
493502 }
494503
495− if (dragging && launcher.state != "drawer") {
504+ if (root.drawerEnabled && dragging && launcher.state != "drawer") {
496505 var drawerHintDistance = panel.width + units.gu(1)
497506 if (distance < drawerHintDistance) {
498507 drawer.x = -drawer.width + Math.min(Math.max(0, distance), drawer.width);
@@ -508,7 +517,7 @@ FocusScope {
508517 onDraggingChanged: {
509518 if (!dragging) {
510519 if (distance > panel.width / 2) {
511− if (distance > panel.width * 3) {
520+ if (root.drawerEnabled && distance > panel.width * 3) {
512521 root.switchToNextState("drawer")
513522 root.focus = true;
514523 } else {
qml/Shell.qml+1
@@ -497,6 +497,7 @@ StyledItem {
497497 lockedVisible: shell.usageScenario == "desktop" && !settings.autohideLauncher && !panel.fullscreenMode
498498 blurSource: greeter.shown ? greeter : stages
499499 topPanelHeight: panel.panelHeight
500+ drawerEnabled: !greeter.shown
500501
501502 onShowDashHome: showHome()
502503 onLauncherApplicationSelected: {
tests/qmltests/Launcher/tst_Drawer.qml+18
@@ -200,5 +200,23 @@ StyledItem {
200200
201201 tryCompare(launcher, "focus", false);
202202 }
203+
204+ function test_drawerDisabled() {
205+ launcher.drawerEnabled = false;
206+
207+ var startX = launcher.dragAreaWidth/2;
208+ var startY = launcher.height/2;
209+ touchFlick(launcher,
210+ startX, startY,
211+ startX+units.gu(35), startY);
212+
213+ var drawer = findChild(launcher, "drawer");
214+ verify(!!drawer);
215+
216+ tryCompare(launcher, "state", "visible");
217+ tryCompare(launcher, "drawerShown", false);
218+
219+ launcher.drawerEnabled = true;
220+ }
203221 }
204222}