mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
taskswitcher: Fix animations when opening from homescreen
This commit is contained in:
parent
7871212461
commit
4e95a4abc3
3 changed files with 14 additions and 5 deletions
|
|
@ -19,8 +19,6 @@ Item {
|
|||
required property var taskSwitcher
|
||||
readonly property var taskSwitcherState: taskSwitcher.taskSwitcherState
|
||||
|
||||
opacity: taskSwitcherState.wasInActiveTask ? 1 : Math.min(1, taskSwitcherState.yPosition / taskSwitcherState.openedYPosition)
|
||||
|
||||
transform: Scale {
|
||||
origin.x: root.width / 2
|
||||
origin.y: root.height / 2
|
||||
|
|
|
|||
|
|
@ -163,8 +163,8 @@ Item {
|
|||
anchors.fill: parent
|
||||
|
||||
color: {
|
||||
// animate background colour only if opening from the homescreen
|
||||
if (taskSwitcherState.wasInActiveTask) {
|
||||
// animate background colour only if we are *not* opening from the homescreen
|
||||
if (taskSwitcherState.wasInActiveTask || !taskSwitcherState.currentlyBeingOpened) {
|
||||
return Qt.rgba(0, 0, 0, 0.6);
|
||||
} else {
|
||||
return Qt.rgba(0, 0, 0, 0.6 * Math.min(1, taskSwitcherState.yPosition / taskSwitcherState.openedYPosition));
|
||||
|
|
@ -190,6 +190,16 @@ Item {
|
|||
// the item is effectively anchored to the flickable bounds
|
||||
TaskList {
|
||||
taskSwitcher: root
|
||||
|
||||
opacity: {
|
||||
// animate opacity only if we are *not* opening from the homescreen
|
||||
if (taskSwitcherState.wasInActiveTask || !taskSwitcherState.currentlyBeingOpened) {
|
||||
return 1;
|
||||
} else {
|
||||
Math.min(1, taskSwitcherState.yPosition / taskSwitcherState.openedYPosition);
|
||||
}
|
||||
}
|
||||
|
||||
x: flickable.contentX
|
||||
width: flickable.width
|
||||
height: flickable.height
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ QtObject {
|
|||
let subtract = (maxScale - 1) * (yPosition / openedYPosition);
|
||||
let finalScale = Math.max(0, Math.min(maxScale, maxScale - subtract));
|
||||
|
||||
// animate scale only if we are *not* opening from the homescreen
|
||||
if (wasInActiveTask || !currentlyBeingOpened) {
|
||||
return finalScale;
|
||||
}
|
||||
|
|
@ -200,7 +201,7 @@ QtObject {
|
|||
target: root
|
||||
property: "yPosition"
|
||||
to: openedYPosition
|
||||
duration: PlasmaCore.Units.longDuration * 2
|
||||
duration: 300
|
||||
easing.type: Easing.OutBack
|
||||
|
||||
onFinished: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue