2 * Copyright (C) 2014 Canonical, Ltd.
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.
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.
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/>.
19 /* This is the base case for surface animations, used when adding/removing * child surfaces.
20 * The class is meant to be overridden and changes/animations provided for state changes.
21 * NB. It is important to release the surface at the end of the "out" animation.
23 * Example - Simple fade in/out
25 * BaseSurfaceAnimation {
26 * outChanges: [ PropertyChanges { target: animation.surface; opacity: 0.0 } ]
29 * NumberAnimation { target: animation.surface; property: "opacity"; duration: 300 }
30 * ScriptAction { script: { if (animation.parent.removing) animation.surface.release(); } }
34 * inChanges: [ PropertyChanges { target: animation.surface; opacity: 1.0 } ]
35 * inAnimations: [ NumberAnimation { target: animation.surface; property: "opacity"; duration: 300 } ]
40 property var container
41 objectName: "sessionAnimation"
43 // changes applied when state changes to "from"
44 property list<QtObject> fromChanges
45 // transition animations when changing state to "from"
46 property list<QtObject> fromAnimations
48 // changes applied when state changes to "to"
49 property list<QtObject> toChanges
50 // transition animations when changing state to "to"
51 property list<QtObject> toAnimations
54 // "prep" state forces toChanges without transition animations.
67 PropertyChanges { target: container; anchors.fill: undefined }
72 extend: "baseAnimation"
81 extend: "baseAnimation"
89 animations: fromAnimations
93 animations: toAnimations