forked from IgorYbema/tscSettings
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathAnimationScreen.qml
More file actions
89 lines (83 loc) · 2.32 KB
/
Copy pathAnimationScreen.qml
File metadata and controls
89 lines (83 loc) · 2.32 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import QtQuick 2.1
import qb.base 1.0
/**
* The base class for any animation screen.
* Provides default onShow & onHide transitions.
*/
Widget {
property bool animationRunning: false
property bool isVisibleinDimState: true
property int animationInterval : 1000
property string qmlAnimationURL
property string qmlAnimationText : "Animation Mode"
property string staticImageT1
property string staticImageT2
property string staticImageT1dim : ""
property string staticImageT2dim : ""
Rectangle {
id: staticOverlay
color: "transparent"
width: isNxt? 1024 : 800
height: isNxt? 600 : 480
Image {
id: webimage
source: isNxt? (dimState & (staticImageT2dim.length>4)) ? staticImageT2dim : staticImageT2 : (dimState & (staticImageT1dim.length>4)) ? staticImageT1dim : staticImageT1
width: parent.width
height: parent.height
} visible: ((isVisibleinDimState || !dimState) && animationRunning)
}
Rectangle {
id: someText
color: "transparent"
width: isNxt? 1024 : 800
height: isNxt? 600 : 480
radius: 4
Text{
id: buttonLabel
anchors{
top: parent.top
topMargin: 2
}
width: parent.width
font.pixelSize: isNxt ? 20 : 14
font.family: qfont.regular.name
font.bold: true
color: !dimState? "black" : "white"
wrapMode: Text.WordWrap
text: qmlAnimationText
}
}
Rectangle {
id: animationCanvas
color: "transparent"
width: isNxt? 1024 : 800
height: isNxt? 600 : 480
Timer {
interval : animationInterval
repeat: true
triggeredOnStart: true
running: animationRunning
onTriggered: {
var component = Qt.createComponent(qmlAnimationURL);
if (component.status === Component.Ready){
finishCreation();
}
else{
component.statusChanged.connect(finishCreation);
}
function finishCreation() {
if (component.status == Component.Ready) {
var spriteObject = component.createObject(animationCanvas);
if (spriteObject == null) {
}
} else{
if (component.status === Component.Error) {
}else{
}
}
}
}
}
visible: (isVisibleinDimState || !dimState)
}
}