| 1 |
/* |
| 2 |
* Copyright (C) 2011-2015 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 version 3 as |
| 6 |
* published by the Free Software Foundation. |
| 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 |
* Authors: |
| 17 |
* Charles Lindsay <[email protected]> |
| 18 |
*/ |
| 19 |
|
| 20 |
import QtQuick 2.9 |
| 21 |
|
| 22 |
// Moves the position and size of the target to the end values. |
| 23 |
/*! |
| 24 |
*/ |
| 25 |
ParallelAnimation { |
| 26 |
id: expandAnimation |
| 27 |
objectName: "expandAnimation" |
| 28 |
|
| 29 |
/*! |
| 30 |
*/ |
| 31 |
property variant target |
| 32 |
|
| 33 |
/*! |
| 34 |
*/ |
| 35 |
property real endX: 0 |
| 36 |
/*! |
| 37 |
*/ |
| 38 |
property real endY: 0 |
| 39 |
/*! |
| 40 |
*/ |
| 41 |
property real endWidth: target.parent.width |
| 42 |
/*! |
| 43 |
*/ |
| 44 |
property real endHeight: target.parent.height |
| 45 |
/*! |
| 46 |
*/ |
| 47 |
property int easingType: Easing.InQuad |
| 48 |
|
| 49 |
/*! |
| 50 |
*/ |
| 51 |
property int duration: 200 |
| 52 |
|
| 53 |
NumberAnimation { |
| 54 |
target: expandAnimation.target |
| 55 |
property: "x" |
| 56 |
to: endX |
| 57 |
duration: expandAnimation.duration |
| 58 |
easing.type: easingType |
| 59 |
} |
| 60 |
|
| 61 |
NumberAnimation { |
| 62 |
target: expandAnimation.target |
| 63 |
property: "y" |
| 64 |
to: endY |
| 65 |
duration: expandAnimation.duration |
| 66 |
easing.type: easingType |
| 67 |
} |
| 68 |
|
| 69 |
NumberAnimation { |
| 70 |
target: expandAnimation.target |
| 71 |
property: "width" |
| 72 |
to: endWidth |
| 73 |
duration: expandAnimation.duration |
| 74 |
easing.type: easingType |
| 75 |
} |
| 76 |
|
| 77 |
NumberAnimation { |
| 78 |
target: expandAnimation.target |
| 79 |
property: "height" |
| 80 |
to: endHeight |
| 81 |
duration: expandAnimation.duration |
| 82 |
easing.type: easingType |
| 83 |
} |
| 84 |
} |