diff --git a/components/mobileshell/qml/navigationpanel/NavigationPanel.qml b/components/mobileshell/qml/navigationpanel/NavigationPanel.qml index 7d55d48a..4938c388 100644 --- a/components/mobileshell/qml/navigationpanel/NavigationPanel.qml +++ b/components/mobileshell/qml/navigationpanel/NavigationPanel.qml @@ -79,11 +79,9 @@ Item { if (root.taskSwitcher.visible) { // update task switcher drag let offsetY = (mouse.y - oldMouseY) * 0.5; // we want to make the gesture take a longer swipe than it being pixel perfect - let offsetX = (mouse.x - oldMouseX) * 0.5; + let offsetX = (mouse.x - oldMouseX) * 0.7; // we want to make the gesture not too hard to swipe, but not too easy taskSwitcher.taskSwitcherState.yPosition = Math.max(0, taskSwitcher.taskSwitcherState.yPosition - offsetY); - - // TODO add x swipe - //taskSwitcher.taskSwitcherState.xPosition -= offsetX; + taskSwitcher.taskSwitcherState.xPosition -= offsetX; } if (!root.taskSwitcher.visible && Math.abs(startMouseY - mouse.y) > PlasmaCore.Units.gridUnit && taskSwitcher.tasksCount) { diff --git a/components/mobileshell/qml/taskswitcher/Task.qml b/components/mobileshell/qml/taskswitcher/Task.qml index 3f1aa4a3..443e2882 100644 --- a/components/mobileshell/qml/taskswitcher/Task.qml +++ b/components/mobileshell/qml/taskswitcher/Task.qml @@ -22,17 +22,13 @@ Item { required property var model required property var displaysModel - readonly property point taskScreenPoint: model ? Qt.point(model.ScreenGeometry.x, model.ScreenGeometry.y) : Qt.point(0, 0) - readonly property real dragOffset: -control.y - - property bool active: model ? model.IsActive : false - required property real previewHeight required property real previewWidth - property bool showHeader: true + readonly property point taskScreenPoint: model ? Qt.point(model.ScreenGeometry.x, model.ScreenGeometry.y) : Qt.point(0, 0) + readonly property real dragOffset: -control.y - property real scale: 1 + property bool showHeader: true opacity: 1 - dragOffset / taskSwitcher.height @@ -178,12 +174,6 @@ Item { color: PlasmaCore.Theme.backgroundColor clip: true - transform: Scale { - origin.x: item.width / 2 - origin.y: item.height / 2 - xScale: delegate.scale - yScale: delegate.scale - } Item { id: item diff --git a/components/mobileshell/qml/taskswitcher/TaskList.qml b/components/mobileshell/qml/taskswitcher/TaskList.qml index 38b1ed0b..26b01872 100644 --- a/components/mobileshell/qml/taskswitcher/TaskList.qml +++ b/components/mobileshell/qml/taskswitcher/TaskList.qml @@ -21,6 +21,13 @@ Item { opacity: taskSwitcherState.wasInActiveTask ? 1 : Math.min(1, taskSwitcherState.yPosition / taskSwitcherState.openedYPosition) + transform: Scale { + origin.x: root.width / 2 + origin.y: root.height / 2 + xScale: taskSwitcherState.currentScale + yScale: taskSwitcherState.currentScale + } + // taphandler activates even if delegate touched TapHandler { onTapped: { @@ -76,7 +83,7 @@ Item { // ensure current task is above others z: taskSwitcherState.currentTaskIndex === currentIndex ? 1 : 0 - showHeader: currentIndex !== taskSwitcherState.currentTaskIndex || !taskSwitcherState.currentlyBeingOpened + showHeader: !taskSwitcherState.currentlyBeingOpened width: taskSwitcherState.taskWidth height: taskSwitcherState.taskHeight @@ -85,13 +92,6 @@ Item { taskSwitcher: root.taskSwitcher displaysModel: root.taskSwitcher.displaysModel - - scale: { - if (taskSwitcherState.currentTaskIndex == currentIndex) { - return taskSwitcherState.currentScale; - } - return 1; - } } } } diff --git a/components/mobileshell/qml/taskswitcher/TaskSwitcherState.qml b/components/mobileshell/qml/taskswitcher/TaskSwitcherState.qml index a8fdb1f0..0a68a582 100644 --- a/components/mobileshell/qml/taskswitcher/TaskSwitcherState.qml +++ b/components/mobileshell/qml/taskswitcher/TaskSwitcherState.qml @@ -167,9 +167,11 @@ QtObject { } // update horizontal state - if (!currentlyBeingOpened) { + let duration = PlasmaCore.Units.longDuration * 2; + if (currentlyBeingOpened) { + animateGoToTaskIndex(currentTaskIndex, duration); + } else { let currentTaskIndexPosition = xPositionFromTaskIndex(currentTaskIndex); - let duration = PlasmaCore.Units.longDuration * 2; if (xPosition < currentTaskIndexPosition) { if (movingRight) { animateGoToTaskIndex(currentTaskIndex, duration); @@ -198,8 +200,8 @@ QtObject { target: root property: "yPosition" to: openedYPosition - duration: PlasmaCore.Units.longDuration - easing.type: Easing.InOutQuad + duration: PlasmaCore.Units.longDuration * 2 + easing.type: Easing.OutBack onFinished: { root.currentlyBeingOpened = false;