| 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 |
// Sets the target to visible at the startOpacity, animates to the endOpacity. |
| 23 |
SequentialAnimation { |
| 24 |
id: fadeInAnimation |
| 25 |
|
| 26 |
/*! |
| 27 |
*/ |
| 28 |
property Item target |
| 29 |
/*! |
| 30 |
*/ |
| 31 |
property real startOpacity: 0 |
| 32 |
/*! |
| 33 |
*/ |
| 34 |
property real endOpacity: 1 |
| 35 |
/*! |
| 36 |
*/ |
| 37 |
property int duration: 200 |
| 38 |
/*! |
| 39 |
*/ |
| 40 |
property int easingType: Easing.InQuad |
| 41 |
|
| 42 |
PropertyAction { |
| 43 |
target: fadeInAnimation.target |
| 44 |
property: "opacity" |
| 45 |
value: startOpacity |
| 46 |
} |
| 47 |
|
| 48 |
PropertyAction { |
| 49 |
target: fadeInAnimation.target |
| 50 |
property: "visible" |
| 51 |
value: true |
| 52 |
} |
| 53 |
|
| 54 |
NumberAnimation { |
| 55 |
target: fadeInAnimation.target |
| 56 |
property: "opacity" |
| 57 |
to: endOpacity |
| 58 |
duration: fadeInAnimation.duration |
| 59 |
easing.type: easingType |
| 60 |
} |
| 61 |
} |