Unity 8
SwipeFromBottomAnimation.qml
1 /*
2  * Copyright (C) 2014 Canonical, Ltd.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; version 3.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 import QtQuick 2.4
18 import Ubuntu.Components 1.3
19 
20 BaseSessionAnimation {
21  id: animation
22 
23  fromChanges: [
24  AnchorChanges {
25  target: container;
26  anchors.top: container.parent.bottom
27  }
28  ]
29  fromAnimations: [
30  SequentialAnimation {
31  // clip so we don't go out of parent's bounds during spread
32  PropertyAction { target: container.parent; property: "clip"; value: true }
33  AnchorAnimation { easing: UbuntuAnimation.StandardEasing; duration: UbuntuAnimation.BriskDuration }
34  PropertyAction { target: container.parent; property: "clip"; value: false }
35  ScriptAction { script: { animation.completed(); } }
36  }
37  ]
38 
39  toChanges: [
40  AnchorChanges {
41  target: container;
42  anchors.top: container.parent.top
43  }
44  ]
45  toAnimations: [
46  SequentialAnimation {
47  // clip so we don't go out of parent's bounds during spread
48  PropertyAction { target: container.parent; property: "clip"; value: true }
49  AnchorAnimation { easing: UbuntuAnimation.StandardEasing; duration: UbuntuAnimation.BriskDuration }
50  PropertyAction { target: container.parent; property: "clip"; value: false }
51  }
52  ]
53 }