forked from AsteroidOS/unofficial-watchfaces
-
Notifications
You must be signed in to change notification settings - Fork 0
/
analog-moega-sushimaster.qml
175 lines (146 loc) · 4.83 KB
/
analog-moega-sushimaster.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
/*
* Copyright (C) 2022 - Timo Könnecke <github.com/eLtMosen>
* 2016 - Sylvia van Os <[email protected]>
* 2015 - Florent Revest <[email protected]>
* 2012 - Vasiliy Sorokin <[email protected]>
* Aleksey Mikhailichenko <[email protected]>
* Arto Jalkanen <[email protected]>
*
* 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.15
import QtGraphicalEffects 1.15
Item {
id: root
property string imgPath: "../watchfaces-img/analog-moega-sushimaster-"
anchors.fill: parent
Item {
id: faceBox
anchors.fill: parent
Image {
id: hourMarks
z: 1
anchors.fill: parent
source: imgPath + "hourmarks.svg"
}
Repeater {
model: 60
Rectangle {
id: minuteStrokes
property real rotM: ((index) - 15) / 60
property real centerX: parent.width / 2 - width / 2
property real centerY: parent.height / 2 - height / 2
z: 1
visible: index % 5
antialiasing : true
width: parent.width * .004
height: parent.height * .016
x: centerX + Math.cos(rotM * 2 * Math.PI) * parent.width * .47
y: centerY + Math.sin(rotM * 2 * Math.PI) * parent.width * .47
color: lowColor
transform: Rotation {
origin.x: width / 2
origin.y: height / 2
angle: (index) * 6
}
}
}
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
horizontalOffset: 2
verticalOffset: 2
radius: 6.0
samples: 13
color: Qt.rgba(0, 0, 0, .6)
}
}
Item {
id: handBox
z: 3
anchors.fill: parent
Image {
id: hourSVG
z: 3
source:imgPath + "hour.svg"
anchors.fill: parent
transform: Rotation {
origin.x: parent.width / 2
origin.y: parent.height / 2
angle: (wallClock.time.getHours() * 30) + (wallClock.time.getMinutes() * .5)
}
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
horizontalOffset: 2
verticalOffset: 2
radius: 6.0
samples: 11
color: Qt.rgba(0, 0, 0, .2)
}
}
Image {
id: minuteSVG
z: 4
source: imgPath + "minute.svg"
anchors.fill: parent
transform: Rotation {
origin.x: parent.width / 2
origin.y: parent.height / 2
angle: (wallClock.time.getMinutes()*6)+(wallClock.time.getSeconds() * 6 / 60)
}
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
horizontalOffset: 3
verticalOffset: 3
radius: 7.0
samples: 13
color: Qt.rgba(0, 0, 0, .3)
}
}
Image {
id: secondSVG
z: 5
visible: !displayAmbient
source: imgPath + "second.svg"
anchors.fill: parent
transform: Rotation {
origin.x: parent.width / 2
origin.y: parent.height / 2
angle: (wallClock.time.getSeconds() * 6)
}
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
horizontalOffset: 4
verticalOffset: 4
radius: 8.0
samples: 17
color: Qt.rgba(0, 0, 0, .3)
}
}
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
horizontalOffset: 4
verticalOffset: 4
radius: 10.0
samples: 21
color: Qt.rgba(0, 0, 0, .6)
}
}
}