diff --git a/kwin/mobiletaskswitcher/qml/TaskSwitcher.qml b/kwin/mobiletaskswitcher/qml/TaskSwitcher.qml index 127a571e..5dd3cdef 100644 --- a/kwin/mobiletaskswitcher/qml/TaskSwitcher.qml +++ b/kwin/mobiletaskswitcher/qml/TaskSwitcher.qml @@ -445,20 +445,18 @@ FocusScope { Behavior on opacity { NumberAnimation { duration: Kirigami.Units.longDuration } } anchors.bottom: parent.bottom - anchors.horizontalCenter: parent.horizontalCenter + anchors.right: parent.horizontalCenter anchors.bottomMargin: taskSwitcherHelpers.openedYPosition * 5 / 8 - anchors.horizontalCenterOffset: { + anchors.rightMargin: { let size = Kirigami.Units.iconSizes.large + Kirigami.Units.largeSpacing * 2; - let offset = (root.state.currentTaskIndex - 0.5) * size; - return offset; + let offset = (root.state.currentTaskIndex + 0.5) * size; + return -offset; } - Behavior on anchors.horizontalCenterOffset { + Behavior on anchors.rightMargin { NumberAnimation { - // TODO: this duration should track the duration of xAnim but that is variable through function parameter - // how do we make sure this is always the same duration? - duration: Kirigami.Units.longDuration * 2; - easing.type: Easing.OutBack; + duration: taskSwitcherHelpers.xAnimDuration; + easing.type: taskSwitcherHelpers.xAnimEasingType; } } diff --git a/kwin/mobiletaskswitcher/qml/TaskSwitcherHelpers.qml b/kwin/mobiletaskswitcher/qml/TaskSwitcherHelpers.qml index 3bf1c6d2..b63d7b0f 100644 --- a/kwin/mobiletaskswitcher/qml/TaskSwitcherHelpers.qml +++ b/kwin/mobiletaskswitcher/qml/TaskSwitcherHelpers.qml @@ -37,6 +37,10 @@ QtObject { // we don't want to continuously send haptics, just once is enough property bool hasVibrated: false + // made as variables to keep x anim in task list and task scrub icon list in sync + property int xAnimDuration: Kirigami.Units.longDuration * 2 + property int xAnimEasingType: Easing.OutExpo + // ~~ measurement constants ~~ // dimensions of a real window on the screen @@ -161,9 +165,9 @@ QtObject { // go to the task index, animated function animateGoToTaskIndex(index, duration = Kirigami.Units.longDuration * 2, easing = Easing.OutExpo) { - xAnim.duration = duration; + xAnimDuration = duration; + xAnimEasingType = easing; xAnim.to = xPositionFromTaskIndex(index); - xAnim.easing.type = easing; xAnim.restart(); } @@ -219,7 +223,8 @@ QtObject { property var xAnim: NumberAnimation { target: root.state property: "xPosition" - easing.type: Easing.OutBack + duration: xAnimDuration + easing.type: xAnimEasingType } property var openAnim: NumberAnimation {