-
Notifications
You must be signed in to change notification settings - Fork 0
/
Screen.qml
62 lines (55 loc) · 1.36 KB
/
Screen.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import QtQuick 2.1
Item {
id: screen
property string color: "red"
property string title: "title"
opacity: 1
function hide() {
screen.state = 'hide';
screen.x = 0;
}
function show(xVal) {
screen.x = xVal;
screen.state = 'show';
}
Rectangle {
id: rect
width: 480
height: 640
color: screen.color
}
Text {
id: title
text: screen.title;
}
states: [
State {
name: "show"
PropertyChanges {
target: screen
x: 0
opacity:1
}
},
State {
name: "hide"
PropertyChanges {
target: screen
opacity:0
}
}
]
transitions: [
Transition {
from:"hide"
to:"show"
NumberAnimation { properties: "x"; duration:500}
NumberAnimation { properties: "opacity"; duration: 700 }
},
Transition {
//from: "show"
to: "hide"
NumberAnimation { properties: "opacity"; duration: 700 }
}
]
}