mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
animation on close
This commit is contained in:
parent
536dc945fd
commit
15e4468834
2 changed files with 25 additions and 6 deletions
|
|
@ -35,12 +35,23 @@ Item {
|
||||||
fill: parent
|
fill: parent
|
||||||
margins: units.gridUnit
|
margins: units.gridUnit
|
||||||
}
|
}
|
||||||
NumberAnimation {
|
SequentialAnimation {
|
||||||
id: slideAnim
|
id: slideAnim
|
||||||
target: background
|
property alias to: internalSlideAnim.to
|
||||||
properties: "x"
|
NumberAnimation {
|
||||||
duration: units.longDuration
|
id: internalSlideAnim
|
||||||
easing.type: Easing.InOutQuad
|
target: background
|
||||||
|
properties: "x"
|
||||||
|
duration: units.longDuration
|
||||||
|
easing.type: Easing.InOutQuad
|
||||||
|
}
|
||||||
|
ScriptAction {
|
||||||
|
script: {
|
||||||
|
if (background.x != 0) {
|
||||||
|
backend.closeByItemId(model.Id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: background
|
id: background
|
||||||
|
|
@ -79,7 +90,8 @@ Item {
|
||||||
onReleased: {
|
onReleased: {
|
||||||
delegate.z = 0;
|
delegate.z = 0;
|
||||||
if (Math.abs(background.x) > background.width/2) {
|
if (Math.abs(background.x) > background.width/2) {
|
||||||
backend.closeByItemId(model.Id);
|
slideAnim.to = background.x > 0 ? background.width*2 : -background.width*2;
|
||||||
|
slideAnim.running = true;
|
||||||
} else {
|
} else {
|
||||||
slideAnim.to = 0;
|
slideAnim.to = 0;
|
||||||
slideAnim.running = true;
|
slideAnim.running = true;
|
||||||
|
|
|
||||||
|
|
@ -121,5 +121,12 @@ FullScreenPanel {
|
||||||
height: window.height
|
height: window.height
|
||||||
}
|
}
|
||||||
delegate: Task {}
|
delegate: Task {}
|
||||||
|
displaced: Transition {
|
||||||
|
NumberAnimation {
|
||||||
|
properties: "x,y"
|
||||||
|
duration: units.longDuration
|
||||||
|
easing.type: Easing.InOutQuad
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue