on xenial help sign in
remove cruft from a faulty merge
8a49798Lukáš Tinkl
qml/Launcher/Launcher.qml+4−26
@@ -497,33 +497,12 @@ FocusScope {
497
497
498 function easeInOutCubic(t) { return t<.5 ? 4*t*t*t : (t-1)*(2*t-2)*(2*t-2)+1 }
498 function easeInOutCubic(t) { return t<.5 ? 4*t*t*t : (t-1)*(2*t-2)*(2*t-2)+1 }
499
499
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−
520 onDistanceChanged: {
500 onDistanceChanged: {
521 if (dragging && launcher.state != "visible" && launcher.state != "drawer") {
501 if (dragging && launcher.state != "visible" && launcher.state != "drawer") {
522 panel.x = -panel.width + Math.min(Math.max(0, distance), panel.width);
502 panel.x = -panel.width + Math.min(Math.max(0, distance), panel.width);
523 }
503 }
524
504
525 if (root.drawerEnabled && dragging && launcher.state != "drawer") {
505 if (root.drawerEnabled && dragging && launcher.state != "drawer") {
526− lastDragPoints.push(distance)
527 var drawerHintDistance = panel.width + units.gu(1)
506 var drawerHintDistance = panel.width + units.gu(1)
528 if (distance < drawerHintDistance) {
507 if (distance < drawerHintDistance) {
529 drawer.anchors.rightMargin = -Math.min(Math.max(0, distance), drawer.width);
508 drawer.anchors.rightMargin = -Math.min(Math.max(0, distance), drawer.width);
@@ -539,18 +518,17 @@ FocusScope {
539 onDraggingChanged: {
518 onDraggingChanged: {
540 if (!dragging) {
519 if (!dragging) {
541 if (distance > panel.width / 2) {
520 if (distance > panel.width / 2) {
542− if (root.drawerEnabled && distance > panel.width * 3 && dragDirection() !== "left") {
521+ if (root.drawerEnabled && distance > panel.width * 3) {
543− root.switchToNextState("drawer");
522+ root.switchToNextState("drawer")
544 root.focus = true;
523 root.focus = true;
545 } else {
524 } else {
546− root.switchToNextState("visible");
525+ root.switchToNextState("visible")
547 }
526 }
548 } else if (root.state === "") {
527 } else if (root.state === "") {
549 // didn't drag far enough. rollback
528 // didn't drag far enough. rollback
550− root.switchToNextState("");
529+ root.switchToNextState("")
551 }
530 }
552 }
531 }
553− lastDragPoints = [];
554 }
532 }
555 }
533 }
556
534