-
Notifications
You must be signed in to change notification settings - Fork 33
/
karlos-matrix.qml
163 lines (151 loc) · 5.29 KB
/
karlos-matrix.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
/*
* Copyright (C) 2018 - Timo Könnecke <el-t-mo@arcor.de>
* 2016 - Sylvia van Os <iamsylvie@openmailbox.org>
* 2015 - Florent Revest <revestflo@gmail.com>
* 2012 - Vasiliy Sorokin <sorokin.vasiliy@gmail.com>
* Aleksey Mikhailichenko <a.v.mich@gmail.com>
* Arto Jalkanen <ajalkane@gmail.com>
* 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.1
import Nemo.Mce 1.0
import org.asteroid.controls 1.0
import org.asteroid.utils 1.0
Item {
Rectangle {
z: 1
id: timeBack
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
color: Qt.rgba(0, 0, 0, 0.7)
width: parent.width
height: parent.height*0.22
}
Text {
z: 6
id: hourDisplay
renderType: Text.NativeRendering
font.pixelSize: parent.height * 0.246
font.family: "Elektra"
font.letterSpacing: parent.width*0.01
color: Qt.rgba(0, 1, 1, 1)
horizontalAlignment: Text.AlignHCenter
anchors {
verticalCenter: parent.verticalCenter
//verticalCenterOffset: parent.height*0.01
horizontalCenter: parent.horizontalCenter
horizontalCenterOffset: parent.width*0.0062
}
text: if (use12H.value) {
wallClock.time.toLocaleString(Qt.locale(), "hh ap").slice(0, 2) + wallClock.time.toLocaleString(Qt.locale(), ":mm")}
else
wallClock.time.toLocaleString(Qt.locale(), "HH") + wallClock.time.toLocaleString(Qt.locale(), ":mm")
}
Text {
z: 7
id: dowDisplay
font.pixelSize: parent.height*0.08
font.family: "Elektra"
color: Qt.rgba(1, 1, 0, 0.9)
horizontalAlignment: Text.AlignHCenter
anchors {
topMargin: parent.height * 0.032
top: hourDisplay.top
right: hourDisplay.left
rightMargin: parent.width*0.035
}
text: Qt.formatDate(wallClock.time, "ddd").slice(0, 3).toUpperCase()
}
Text {
z: 5
id: dateDisplay
font.pixelSize: parent.height * 0.123
font.family: "Elektra"
font.styleName:"Thin"
color: Qt.rgba(1, 0, 0.5, 1)
horizontalAlignment: Text.AlignHCenter
anchors {
bottomMargin: parent.height * 0.0245
bottom: hourDisplay.bottom
right: hourDisplay.left
rightMargin: parent.width*0.0354
}
text: Qt.formatDate(wallClock.time, "dd")
}
Text {
z: 6
id: secondDisplay
renderType: Text.NativeRendering
font.pixelSize: parent.height * 0.123
font.family: "Elektra"
font.styleName:"Thin"
color: Qt.rgba(0, 1, 1, 0.9)
horizontalAlignment: Text.AlignHCenter
anchors {
topMargin: parent.height * 0.0246
top: hourDisplay.top
left: hourDisplay.right
leftMargin: parent.width*0.024
}
//x: parent.width / 6 * 5.35 - width / 2
text: wallClock.time.toLocaleString(Qt.locale(), "ss")
}
Text {
z: 8
id: apDisplay
visible: use12H.value
font.pixelSize: parent.height*0.08
font.family: "Elektra"
color: Qt.rgba(1, 0, 1, 0.95)
horizontalAlignment: Text.AlignHCenter
anchors {
bottomMargin: parent.height * 0.032
bottom: hourDisplay.bottom
left: hourDisplay.right
leftMargin: parent.width*0.0250
}
text: wallClock.time.toLocaleString(Qt.locale(), "ap").slice(0, 2).toUpperCase()
}
Rectangle {
id: batteryBack
z: 8
anchors {
bottom: timeBack.top
//topMargin: -parent.height*0.03
horizontalCenter: parent.horizontalCenter
}
color: batteryChargePercentage.percent < 30 ? 'red': batteryChargePercentage.percent < 60 ? 'yellow': Qt.rgba(0, 1, 0, 1)
width: parent.width/100*batteryChargePercentage.percent
height: parent.height * 0.004
}
Text {
z: 8
id: batteryDisplay
font.pixelSize: parent.height*0.05
font.family: "Elektra"
color: batteryChargePercentage.percent < 30 ? 'red': batteryChargePercentage.percent < 60 ? 'yellow': Qt.rgba(0, 1, 0, 1)
horizontalAlignment: Text.AlignHCenter
anchors {
top: batteryBack.bottom
topMargin: -parent.height*0.0055
horizontalCenter: parent.horizontalCenter
}
text: batteryChargePercentage.percent
}
MceBatteryLevel {
id: batteryChargePercentage
}
}