-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathanalog-halloween.qml
96 lines (89 loc) · 3.27 KB
/
analog-halloween.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
/*
* Copyright (C) 2021 - Ed Beroset <github.com/beroset>
* 2021 - CosmosDev <github.com/CosmosDev>
* 2021 - 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.9
Item {
property string imgPath: "../watchfaces-img/analog-halloween-"
Repeater {
model: 12
Rectangle {
z: 1
id: hourTicks
antialiasing : true
property var rotM: ((index) - 3)/12
property var centerX: parent.width/2-width/2
property var centerY: parent.height/2-height/2
x: centerX+Math.cos(rotM * 2 * Math.PI)*parent.width*0.46
y: centerY+Math.sin(rotM * 2 * Math.PI)*parent.width*0.46
color: "orange"
width: parent.width*0.02
height: parent.height*0.03
opacity: 0.9
transform: Rotation { origin.x: width/2; origin.y: height/2; angle: (index)*30}
}
}
Image {
id: hourSVG
z: 2
source: imgPath + "hour.svg"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
width: parent.width
height: parent.height
transform: Rotation {
origin.x: parent.width/2;
origin.y: parent.height/2;
angle: (wallClock.time.getHours()*30) + (wallClock.time.getMinutes()*0.5)
}
}
Image {
id: minuteSVG
z: 3
source: imgPath + "minute.svg"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
width: parent.width
height: parent.height
transform: Rotation {
origin.x: parent.width/2;
origin.y: parent.height/2;
angle: (wallClock.time.getMinutes()*6)
}
}
Image {
id: secondSVG
z: 4
visible: !displayAmbient
source: imgPath + "second.svg"
anchors.centerIn: parent
width: parent.width
height: parent.height
transform: Rotation {
origin.x: parent.width/2;
origin.y: parent.height/2;
angle: (wallClock.time.getSeconds()*6)+6
Behavior on angle { RotationAnimation { duration: 1000; direction: RotationAnimation.Clockwise } }
}
}
}