-
Notifications
You must be signed in to change notification settings - Fork 1
/
view.qml
240 lines (208 loc) · 4.91 KB
/
view.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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
import QtQuick 1.0
Rectangle {
width: 800
height: 600
color: "white"
Text {
text: "Namensschild drucken:"
font.family: "Lato"
font.pixelSize: 60
font.weight: Font.Normal
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: badge.top
anchors.bottomMargin: 20
}
Rectangle {
anchors.centerIn: parent
objectName: "badge"
id: badge
width: 720
height: 420
Text {
text: "Bitte warten..."
font.family: "Lato"
font.pixelSize: 50
anchors.centerIn: parent
visible: true
objectName: "waitText"
}
Rectangle {
anchors.centerIn: parent
border.width: 4
border.color: "black"
color: "white";
radius: 20
width: 700
height: 400
id: nameBadge
objectName: "nameBadge"
TextInput {
text: "Vorname"
font.family: "Lato"
font.weight: Font.Normal
font.pixelSize: Math.min(240 * (600/invisibleText.width), 240)
id: inputName
anchors.left: parent.left
anchors.leftMargin: 30
anchors.baseline: inputTwitter.top
anchors.baselineOffset: -(30 + font.pixelSize)
selectByMouse: true
objectName: "inputName"
focus: true
Keys.onPressed: {
if (event.key == Qt.Key_Escape) {
inputName.text = "Vorname";
inputTwitter.text = "@twitter";
inputName.focus = true;
inputName.selectAll();
}
if (event.key == Qt.Key_Tab || event.key == Qt.Key_Return) {
inputTwitter.select(1,8);
inputTwitter.focus = true;
}
}
}
TextInput {
text: "@twitter"
anchors.baseline: parent.bottom
anchors.baselineOffset: -(30 + font.pixelSize)
anchors.left: parent.left
anchors.leftMargin: 30
font.family: "Lato"
font.weight: Font.Normal
font.pixelSize: 60
selectByMouse: true
id: inputTwitter
objectName: "inputTwitter"
color: (text == "@twitter") ? "#999" : "#000"
MouseArea {
anchors.fill: parent
enabled: inputTwitter.focus == false && inputTwitter.text == "@twitter"
onClicked: {
inputTwitter.select(1,8);
inputTwitter.focus = true;
}
}
Keys.onPressed: {
if (event.key == Qt.Key_Escape) {
inputName.text = "Vorname";
inputTwitter.text = "@twitter";
inputName.focus = true;
inputName.selectAll();
}
if (event.key == Qt.Key_Return) {
handler.run();
}
}
}
Image {
source: "piandmore-small.png"
anchors.right: parent.right
anchors.rightMargin: 20
anchors.top: parent.top
anchors.topMargin: 20
height: 70
fillMode: Image.PreserveAspectFit
smooth: true
}
Text {
text: "#pam10"
anchors.baseline: parent.bottom
anchors.baselineOffset: -34
anchors.right: parent.right
anchors.rightMargin: 30
font.family: "Lato"
font.weight: Font.Normal
font.pixelSize: 60
visible: (inputTwitter.text.length < 11)
}
Text {
text: "Los #XXXX"
anchors.right: parent.right
anchors.rightMargin: -70
anchors.verticalCenter: parent.verticalCenter
rotation: -90
font.family: "monospace"
font.weight: Font.Normal
font.pixelSize: 40
objectName: "textLos"
//visible: x1.visible
id: textLos
}
}
Text {
text: inputName.text
font.family: "Lato"
font.pixelSize: 240
id: invisibleText
visible: false
}
}
Text {
anchors.left: badge.left
anchors.leftMargin: 10
anchors.top: badge.bottom
anchors.topMargin: 40
opacity: nameBadge.opacity
font.family: "Lato"
font.pixelSize: 20
font.weight: Font.Normal
text: "Am Ende der Veranstaltung werden unter allen Anwesenden Sachpreise verlost (Bücher, Gadgets, etc.). Dein Namensschild ist das Los. Der Rechtsweg ist ausgeschlossen."
wrapMode: Text.WordWrap
width: 450
}
Rectangle {
anchors.right: badge.right
anchors.top: badge.bottom
anchors.topMargin: 40
width: 130
height: 40
color: "#e9e9e9"
opacity: nameBadge.opacity
Text {
font.family: "Lato"
font.pixelSize: 20
font.weight: Font.Normal
anchors.centerIn: parent
color: (inputName.text == "Vorname" || inputName.text.length < 2) ? "#999" : "#000"
text: "Drucken >>"
}
Text {
font.family: "Lato"
font.pixelSize: 16
font.weight: Font.Normal
anchors.top: parent.bottom
anchors.topMargin: 10
anchors.left: parent.left
color: "#000"
text: "Namensschild bitte nicht auf empfindliche Stoffe kleben."
}
MouseArea {
anchors.fill: parent
onClicked: {
if (inputName.text == "Vorname" || inputName.text.length < 2) {
} else {
enabled = false;
handler.run();
}
}
objectName: "printButtonArea"
}
}
PropertyAnimation {
id: animateNameBadgeOff
objectName: "animateNameBadgeOff"
target: nameBadge
properties: "opacity"
to: 0
duration: 200
}
PropertyAnimation {
id: animateNameBadgeOn
objectName: "animateNameBadgeOn"
target: nameBadge
properties: "opacity"
to: 1
duration: 200
}
}