Debian Codegraph @

rc/qml/Utility/FadeOutAnimation.qml

raw
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 // then returns the startOpacity but with visible set to false.
24 SequentialAnimation {
25 id: fadeOutAnimation
26
27 /*!
28 */
29 property Item target
30 /*!
31 */
32 property real startOpacity: 1
33 /*!
34 */
35 property real endOpacity: 0
36 /*!
37 */
38 property int duration: 200
39 /*!
40 */
41 property int easingType: Easing.OutQuad
42
43 PropertyAction {
44 target: fadeOutAnimation.target
45 property: "opacity"
46 value: startOpacity
47 }
48
49 PropertyAction {
50 target: fadeOutAnimation.target
51 property: "visible"
52 value: true
53 }
54
55 NumberAnimation {
56 target: fadeOutAnimation.target
57 property: "opacity"
58 to: endOpacity
59 duration: fadeOutAnimation.duration
60 easing.type: easingType
61 }
62
63 PropertyAction {
64 target: fadeOutAnimation.target
65 property: "visible"
66 value: false
67 }
68
69 PropertyAction {
70 target: fadeOutAnimation.target
71 property: "opacity"
72 value: startOpacity
73 }
74 }