@@ -497,33 +497,12 @@ FocusScope {
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 }
500− property var lastDragPoints: []
502− function dragDirection() {
503− if (lastDragPoints.length < 5) {
509− for (var i = lastDragPoints.length - 5; i < lastDragPoints.length; i++) {
510− if (toRight && lastDragPoints[i] < lastDragPoints[i-1]) {
513− if (toLeft && lastDragPoints[i] > lastDragPoints[i-1]) {
517− return toRight ? "right" : toLeft ? "left" : "unknown";
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);
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;
546− root.switchToNextState("visible");
525+ root.switchToNextState("visible")
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("")
553− lastDragPoints = [];