diff options
Diffstat (limited to 'prototype_2016/third_party/qml-material/src/components/Wave.qml')
-rw-r--r-- | prototype_2016/third_party/qml-material/src/components/Wave.qml | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/prototype_2016/third_party/qml-material/src/components/Wave.qml b/prototype_2016/third_party/qml-material/src/components/Wave.qml deleted file mode 100644 index 3a0afb4..0000000 --- a/prototype_2016/third_party/qml-material/src/components/Wave.qml +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | /***** THIS FILE CANNOT BE RELICENSED UNDER THE MPL YET *****/ | ||
2 | |||
3 | /* | ||
4 | * QML Material - An application framework implementing Material Design. | ||
5 | * Copyright (C) 2014 Bogdan Cuza <bogdan.cuza@hotmail.com> | ||
6 | * | ||
7 | * This program is free software: you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU Lesser General Public License as | ||
9 | * published by the Free Software Foundation, either version 2.1 of the | ||
10 | * License, or (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU Lesser General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU Lesser General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | ||
20 | |||
21 | import QtQuick 2.4 | ||
22 | |||
23 | /*! | ||
24 | \qmltype Wave | ||
25 | \inqmlmodule Material | ||
26 | |||
27 | \brief Provides a wave animation for transitioning between views of content. | ||
28 | */ | ||
29 | Rectangle { | ||
30 | id: wave | ||
31 | |||
32 | property bool opened | ||
33 | property real size | ||
34 | property real initialX | ||
35 | property real initialY | ||
36 | property real abstractWidth: parent.width | ||
37 | property real abstractHeight: parent.height | ||
38 | property real diameter: 2*Math.sqrt(Math.pow(Math.max(initialX, abstractWidth - initialX), 2) + Math.pow(Math.max(initialY, abstractHeight - initialY), 2)) | ||
39 | |||
40 | signal finished(bool opened) | ||
41 | |||
42 | function open(x, y) { | ||
43 | wave.initialX = x; | ||
44 | wave.initialY = y; | ||
45 | wave.opened = true; | ||
46 | } | ||
47 | |||
48 | function close(x, y) { | ||
49 | wave.initialX = x; | ||
50 | wave.initialY = y; | ||
51 | wave.opened = false; | ||
52 | } | ||
53 | |||
54 | width: size | ||
55 | height: size | ||
56 | radius: size/2 | ||
57 | x: initialX - size/2 | ||
58 | y: initialY - size/2 | ||
59 | |||
60 | states: State { | ||
61 | name: "opened" | ||
62 | when: wave.opened | ||
63 | |||
64 | PropertyChanges { | ||
65 | target: wave | ||
66 | size: wave.diameter | ||
67 | } | ||
68 | } | ||
69 | |||
70 | transitions: Transition { | ||
71 | from: "" | ||
72 | to: "opened" | ||
73 | reversible: true | ||
74 | |||
75 | SequentialAnimation { | ||
76 | NumberAnimation { | ||
77 | property: "size" | ||
78 | easing.type: Easing.OutCubic | ||
79 | } | ||
80 | ScriptAction { | ||
81 | script: wave.finished(wave.opened) | ||
82 | } | ||
83 | } | ||
84 | } | ||
85 | } | ||