-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathdigital-fat-bwoy-slim.qml
executable file
·336 lines (316 loc) · 10.4 KB
/
digital-fat-bwoy-slim.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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
/*
* Copyright (C) 2021 - Timo Könnecke <github.com/eLtMosen>
*
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.9
import QtGraphicalEffects 1.12
Item {
id: root
property string imgPath: "../watchfaces-img/digital-fat-bwoy-slim-"
anchors.centerIn: parent
width: parent.width
height: parent.height
property bool hourLeadingOne: use12H.value ?
wallClock.time.toLocaleString(Qt.locale(), "hh ap").slice(0, 1) === "1" :
wallClock.time.toLocaleString(Qt.locale(), "HH").slice(0, 1) === "1"
property bool hourEndingOne: use12H.value ?
wallClock.time.toLocaleString(Qt.locale(), "hh ap").slice(1, 2) === "1" :
wallClock.time.toLocaleString(Qt.locale(), "HH").slice(1, 2) === "1"
property bool minuteLeadingOne: wallClock.time.toLocaleString(Qt.locale(), "mm").slice(0, 1) === "1"
property bool minuteEndingOne: wallClock.time.toLocaleString(Qt.locale(), "mm").slice(1, 2) === "1"
Text {
z: 0
id: dowDisplay
renderType: Text.NativeRendering
visible: !displayAmbient
font.pixelSize: root.height * 0.08
font.family: "Outfit"
font.styleName: "ExtraLight"
font.letterSpacing: -root.height * 0.001
color: "#ccffffff"
horizontalAlignment: Text.AlignHCenter
anchors {
bottom: root.verticalCenter
bottomMargin: root.height*0.286
horizontalCenter: root.horizontalCenter
}
text: wallClock.time.toLocaleString(Qt.locale(), "dddd").toUpperCase()
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
horizontalOffset: 2
verticalOffset: 2
radius: 5.0
samples: 6
color: "#bb000000"
}
}
Text {
z: 4
id: apDisplay
renderType: Text.NativeRendering
visible: use12H.value
font.pixelSize: root.height*0.08
font.family: "NASDAQER"
font.styleName: "Bold"
style: Text.Outline
styleColor: "#ddffffff"
font.letterSpacing: root.height*0.0002
color: "#22ffffff"
anchors {
left: topRight.right
leftMargin: hourLeadingOne ?
hourEndingOne ?
-parent.width * 0.096 :
parent.width * 0.02 :
hourEndingOne ?
-parent.width * 0.096 :
parent.width * 0.02
bottom: topRight.bottom
bottomMargin: parent.width * 0.038
}
text: wallClock.time.toLocaleString(Qt.locale(), "ap").toUpperCase()
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
horizontalOffset: 2
verticalOffset: 2
radius: 5.0
samples: 6
color: "#bb000000"
}
}
Image {
id: topLeft
z: 1
visible: false
smooth: true
fillMode: Image.PreserveAspectFit
anchors {
right: parent.horizontalCenter
rightMargin: hourLeadingOne ? parent.width * 0.094 : parent.width * 0.004
bottom: parent.verticalCenter
bottomMargin: -parent.width * 0.084
}
sourceSize: Qt.size(
parent.width * 0.36,
parent.height * 0.36
)
source: use12H.value ?
imgPath + wallClock.time.toLocaleString(Qt.locale(), "hh ap").slice(0, 1) + ".svg" :
imgPath + wallClock.time.toLocaleString(Qt.locale(), "HH").slice(0, 1) + ".svg"
}
Image {
id: topRight
z: 2
visible: false
smooth: true
fillMode: Image.PreserveAspectFit
anchors {
left: topLeft.right
leftMargin: hourLeadingOne ?
hourEndingOne ?
-parent.width * 0.14 :
-parent.width * 0.092 :
hourEndingOne ?
-parent.width * 0.094 :
-parent.width * 0.064
bottom: topLeft.bottom
}
sourceSize: Qt.size(
parent.width * 0.36,
parent.height * 0.36
)
source: use12H.value ?
imgPath + wallClock.time.toLocaleString(Qt.locale(), "hh ap").slice(1, 2) + ".svg" :
imgPath + wallClock.time.toLocaleString(Qt.locale(), "HH").slice(1, 2) + ".svg"
}
Image {
id: bottomLeft
z: 3
visible: false
smooth: true
fillMode: Image.PreserveAspectFit
anchors {
right: parent.horizontalCenter
rightMargin: minuteLeadingOne ? -parent.width * 0.164 : -parent.width * 0.172
top: parent.verticalCenter
topMargin: parent.width * 0.032
}
sourceSize: Qt.size(
parent.width * 0.24,
parent.height * 0.24
)
source: imgPath + wallClock.time.toLocaleString(Qt.locale(), "mm").slice(0, 1) + ".svg"
}
Image {
id: bottomRight
z: 4
visible: false
smooth: true
fillMode: Image.PreserveAspectFit
anchors {
left: bottomLeft.right
leftMargin: minuteLeadingOne ? -parent.width * 0.065 : minuteEndingOne ? -parent.width * 0.062 : -parent.width * 0.04
bottom: bottomLeft.bottom
}
sourceSize: Qt.size(
parent.width * 0.24,
parent.height*0.24
)
source: imgPath + wallClock.time.toLocaleString(Qt.locale(), "mm").slice(1, 2) + ".svg"
}
OpacityMask {
anchors.fill: topLeft
source: pinkColor
maskSource: topLeft
opacity: 0.85
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
horizontalOffset: 3
verticalOffset: 3
radius: 10.0
samples: 12
color: "#bb000000"
}
}
OpacityMask {
anchors.fill: topRight
source: pinkColor
maskSource: topRight
opacity: 0.85
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
horizontalOffset: 3
verticalOffset: 3
radius: 10.0
samples: 12
color: "#bb000000"
}
}
OpacityMask {
anchors.fill: bottomLeft
source: blueColor
maskSource: bottomLeft
opacity: 0.85
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
horizontalOffset: 3
verticalOffset: 3
radius: 10.0
samples: 12
color: "#bb000000"
}
}
OpacityMask {
anchors.fill: bottomRight
source: blueColor
maskSource: bottomRight
opacity: 0.85
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
horizontalOffset: 3
verticalOffset: 3
radius: 10.0
samples: 12
color: "#bb000000"
}
}
LinearGradient {
id: blueColor
anchors.fill: parent
smooth: true
visible: false
start: Qt.point(800, 0)
end: Qt.point(0, 0)
gradient: Gradient {
GradientStop { position: 0.0; color: "#96ffFF" }
GradientStop { position: 0.6; color: "#51D6FF" }
}
}
LinearGradient {
id: pinkColor
anchors.fill: parent
smooth: true
visible: false
start: Qt.point(800, 0)
end: Qt.point(0, 0)
gradient: Gradient {
GradientStop { position: 0.0; color: "#FFefFF" }
GradientStop { position: 0.6; color: "#F9B9F2" }
}
}
Text {
z: 0
id: dayDisplay
renderType: Text.NativeRendering
visible: !displayAmbient
font.pixelSize: root.height * 0.2
font.family: "Outfit"
font.styleName: "ExtraLight"
font.letterSpacing: -root.height*0.008
color: "#ccffffff"
horizontalAlignment: Text.AlignHCenter
anchors {
top: root.verticalCenter
topMargin: root.height*0.06
right: root.horizontalCenter
rightMargin: root.height*0.112
}
text: wallClock.time.toLocaleString(Qt.locale(), "dd").toUpperCase()
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
horizontalOffset: 2
verticalOffset: 2
radius: 5.0
samples: 6
color: "#bb000000"
}
}
Text {
z: 0
id: monthDisplay
renderType: Text.NativeRendering
visible: !displayAmbient
font.pixelSize: root.height * 0.08
font.letterSpacing: -root.height*0.001
font.family: "Outfit"
font.styleName: "ExtraLight"
color: "#ccffffff"
horizontalAlignment: Text.AlignHCenter
anchors {
top: root.verticalCenter
topMargin: root.height*0.286
horizontalCenter: root.horizontalCenter
}
text: wallClock.time.toLocaleString(Qt.locale(), "MMMM").toUpperCase()
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
horizontalOffset: 2
verticalOffset: 2
radius: 5.0
samples: 6
color: "#bb000000"
}
}
}