on xenial help sign in
remove cruft from a faulty merge
commit8a49798ef772adad5ee1700dc51cfc69bdfabe4d authorLukáš Tinkl <lukas.tinkl@canonical.com> dateThu 8 Dec 2016, 13:36 (10 years ago) parentc6ce625
1 file changed+4−26
qml/Launcher/Launcher.qml+4−26
qml/Launcher/Launcher.qml+4−26
@@ -497,33 +497,12 @@ FocusScope {
497497
498498 function easeInOutCubic(t) { return t<.5 ? 4*t*t*t : (t-1)*(2*t-2)*(2*t-2)+1 }
499499
500− property var lastDragPoints: []
501−
502− function dragDirection() {
503− if (lastDragPoints.length < 5) {
504− return "unknown";
505− }
506−
507− var toRight = true;
508− var toLeft = true;
509− for (var i = lastDragPoints.length - 5; i < lastDragPoints.length; i++) {
510− if (toRight && lastDragPoints[i] < lastDragPoints[i-1]) {
511− toRight = false;
512− }
513− if (toLeft && lastDragPoints[i] > lastDragPoints[i-1]) {
514− toLeft = false;
515− }
516− }
517− return toRight ? "right" : toLeft ? "left" : "unknown";
518− }
519−
520500 onDistanceChanged: {
521501 if (dragging && launcher.state != "visible" && launcher.state != "drawer") {
522502 panel.x = -panel.width + Math.min(Math.max(0, distance), panel.width);
523503 }
524504
525505 if (root.drawerEnabled && dragging && launcher.state != "drawer") {
526− lastDragPoints.push(distance)
527506 var drawerHintDistance = panel.width + units.gu(1)
528507 if (distance < drawerHintDistance) {
529508 drawer.anchors.rightMargin = -Math.min(Math.max(0, distance), drawer.width);
@@ -539,18 +518,17 @@ FocusScope {
539518 onDraggingChanged: {
540519 if (!dragging) {
541520 if (distance > panel.width / 2) {
542− if (root.drawerEnabled && distance > panel.width * 3 && dragDirection() !== "left") {
543− root.switchToNextState("drawer");
521+ if (root.drawerEnabled && distance > panel.width * 3) {
522+ root.switchToNextState("drawer")
544523 root.focus = true;
545524 } else {
546− root.switchToNextState("visible");
525+ root.switchToNextState("visible")
547526 }
548527 } else if (root.state === "") {
549528 // didn't drag far enough. rollback
550− root.switchToNextState("");
529+ root.switchToNextState("")
551530 }
552531 }
553− lastDragPoints = [];
554532 }
555533 }
556534