forked from IgorYbema/tscSettings
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDateTime.qml
More file actions
47 lines (41 loc) · 1.38 KB
/
DateTime.qml
File metadata and controls
47 lines (41 loc) · 1.38 KB
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
import QtQuick 2.1
import qb.base 1.0
import qb.components 1.0
Widget {
id: dateTime
width: 150
height: parent.height
Text {
id: txtTime
text: ""
color: colors.white
anchors.centerIn: parent
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: isNxt ? 52 : 42
font.family: qfont.bold.name
visible: globals.tsc["showTime"]
}
Text {
id: txtDate
text: ""
color: colors.white
anchors.left: txtTime.right
anchors.leftMargin: 20
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: isNxt ? 36 : 26
font.family: qfont.bold.name
visible: globals.tsc["showDate"]
}
Timer {
id: datetimeTimer
interval: 1000
triggeredOnStart: true
running: globals.tsc["showTime"] || globals.tsc["showDate"]
repeat: true
onTriggered: {
var now = new Date().getTime();
txtTime.text = i18n.dateTime(now, i18n.time_yes);
txtDate.text = i18n.dateTime(now, i18n.mon_full);
}
}
}