mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23: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,13 +35,24 @@ Item {
|
|||
fill: parent
|
||||
margins: units.gridUnit
|
||||
}
|
||||
NumberAnimation {
|
||||
SequentialAnimation {
|
||||
id: slideAnim
|
||||
property alias to: internalSlideAnim.to
|
||||
NumberAnimation {
|
||||
id: internalSlideAnim
|
||||
target: background
|
||||
properties: "x"
|
||||
duration: units.longDuration
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
ScriptAction {
|
||||
script: {
|
||||
if (background.x != 0) {
|
||||
backend.closeByItemId(model.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
id: background
|
||||
|
||||
|
|
@ -79,7 +90,8 @@ Item {
|
|||
onReleased: {
|
||||
delegate.z = 0;
|
||||
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 {
|
||||
slideAnim.to = 0;
|
||||
slideAnim.running = true;
|
||||
|
|
|
|||
|
|
@ -121,5 +121,12 @@ FullScreenPanel {
|
|||
height: window.height
|
||||
}
|
||||
delegate: Task {}
|
||||
displaced: Transition {
|
||||
NumberAnimation {
|
||||
properties: "x,y"
|
||||
duration: units.longDuration
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue