on xenial help sign in
clean up the long left edge swipe code to show the dash
1816c2eMichael Zanetti
qml/Launcher/Launcher.qml−7
@@ -32,7 +32,6 @@ FocusScope {
32
32
33 property int panelWidth: units.gu(10)
33 property int panelWidth: units.gu(10)
34 property int dragAreaWidth: units.gu(1)
34 property int dragAreaWidth: units.gu(1)
35− property int minimizeDistance: units.gu(26)
36 property real progress: dragArea.dragging && dragArea.touchPosition.x > panelWidth ?
35 property real progress: dragArea.dragging && dragArea.touchPosition.x > panelWidth ?
37 (width * (dragArea.touchPosition.x-panelWidth) / (width - panelWidth)) : 0
36 (width * (dragArea.touchPosition.x-panelWidth) / (width - panelWidth)) : 0
38
37
@@ -49,9 +48,6 @@ FocusScope {
49 // emitted when an application is selected
48 // emitted when an application is selected
50 signal launcherApplicationSelected(string appId)
49 signal launcherApplicationSelected(string appId)
51
50
52− // emitted when the apps dash should be shown because of a swipe gesture
53− signal dash()
54−
55 // emitted when the dash icon in the launcher has been tapped
51 // emitted when the dash icon in the launcher has been tapped
56 signal showDashHome()
52 signal showDashHome()
57
53
@@ -510,9 +506,6 @@ FocusScope {
510 root.switchToNextState("drawer")
506 root.switchToNextState("drawer")
511 } else {
507 } else {
512 root.switchToNextState("visible")
508 root.switchToNextState("visible")
513− if (distance > minimizeDistance) {
514− root.dash();
515− }
516 }
509 }
517 } else if (root.state === "") {
510 } else if (root.state === "") {
518 // didn't drag far enough. rollback
511 // didn't drag far enough. rollback
qml/Shell.qml−28
@@ -308,7 +308,6 @@ StyledItem {
308
308
309 leftMargin: shell.usageScenario == "desktop" && !settings.autohideLauncher ? launcher.panelWidth: 0
309 leftMargin: shell.usageScenario == "desktop" && !settings.autohideLauncher ? launcher.panelWidth: 0
310 suspended: greeter.shown
310 suspended: greeter.shown
311− keepDashRunning: launcher.shown || launcher.dashSwipe
312 altTabPressed: physicalKeysMapper.altTabPressed
311 altTabPressed: physicalKeysMapper.altTabPressed
313 oskEnabled: shell.oskEnabled
312 oskEnabled: shell.oskEnabled
314
313
@@ -435,18 +434,6 @@ StyledItem {
435 }
434 }
436 }
435 }
437
436
438− function showDash() {
439− if (greeter.notifyShowingDashFromDrag()) {
440− launcher.fadeOut();
441− }
442−
443− if (!greeter.locked && tutorial.launcherLongSwipeEnabled
444− && ApplicationManager.focusedApplicationId != "unity8-dash") {
445− ApplicationManager.requestFocusApplication("unity8-dash")
446− launcher.fadeOut();
447− }
448− }
449−
450 Item {
437 Item {
451 id: overlay
438 id: overlay
452 z: 10
439 z: 10
@@ -496,15 +483,6 @@ StyledItem {
496 id: launcher
483 id: launcher
497 objectName: "launcher"
484 objectName: "launcher"
498
485
499− /*
500− * Since the Dash doesn't have the same controll over surfaces that the
501− * Shell does, it can't slowly move the scope out of the way, as the shell
502− * does with apps, and the dash is show instantly. This allows for some
503− * leeway and prevents accidental home swipes.
504− */
505− readonly property real offset: shell.focusedApplicationId == "unity8-dash" ? units.gu(12) : 0
506− readonly property bool dashSwipe: progress > offset
507−
508 anchors.top: parent.top
486 anchors.top: parent.top
509 anchors.topMargin: inverted ? 0 : panel.panelHeight
487 anchors.topMargin: inverted ? 0 : panel.panelHeight
510 anchors.bottom: parent.bottom
488 anchors.bottom: parent.bottom
@@ -523,12 +501,6 @@ StyledItem {
523 topPanelHeight: panel.panelHeight
501 topPanelHeight: panel.panelHeight
524
502
525 onShowDashHome: showHome()
503 onShowDashHome: showHome()
526− onDash: showDash()
527− onDashSwipeChanged: {
528− if (dashSwipe) {
529− dash.setCurrentScope(0, false, true)
530− }
531− }
532 onLauncherApplicationSelected: {
504 onLauncherApplicationSelected: {
533 greeter.notifyUserRequestedApp();
505 greeter.notifyUserRequestedApp();
534 shell.activateApplication(appId);
506 shell.activateApplication(appId);
qml/Stage/Stage.qml+1−2
@@ -36,7 +36,6 @@ FocusScope {
36 property url background
36 property url background
37 property int dragAreaWidth
37 property int dragAreaWidth
38 property bool interactive
38 property bool interactive
39− property bool keepDashRunning: true
40 property real nativeHeight
39 property real nativeHeight
41 property real nativeWidth
40 property real nativeWidth
42 property QtObject orientations
41 property QtObject orientations
@@ -375,7 +374,7 @@ FocusScope {
375 // in staged mode, when it switches to Windowed mode it will suddenly
374 // in staged mode, when it switches to Windowed mode it will suddenly
376 // resume all those apps at once. We might want to avoid that.
375 // resume all those apps at once. We might want to avoid that.
377 value: root.mode === "windowed"
376 value: root.mode === "windowed"
378− || (isDash && root.keepDashRunning)
377+ || isDash
379 || (!root.suspended && model.application && priv.focusedAppDelegate &&
378 || (!root.suspended && model.application && priv.focusedAppDelegate &&
380 (priv.focusedAppDelegate.appId === model.application.appId ||
379 (priv.focusedAppDelegate.appId === model.application.appId ||
381 priv.mainStageAppId === model.application.appId ||
380 priv.mainStageAppId === model.application.appId ||