allow configuring time format on theme.conf

This commit is contained in:
eximus
2024-03-16 14:06:52 -04:00
parent 74fb9d0b2c
commit c8d2a8f50d
2 changed files with 28 additions and 4 deletions

View File

@@ -204,15 +204,38 @@ Rectangle {
anchors.fill: parent
color: "transparent"
Clock {
Column {
id: clock
property date dateTime: new Date()
property color color: "white"
y: parent.height * config.relativePositionY - clock.height / 2
x: parent.width * config.relativePositionX - clock.width / 2
color: "white"
timeFont.family: textFont.name
dateFont.family: textFont.name
Timer {
interval: 100; running: true; repeat: true;
onTriggered: clock.dateTime = new Date()
}
Text {
id: time
anchors.horizontalCenter: parent.horizontalCenter
color: clock.color
text : Qt.formatTime(clock.dateTime, config.timeFormat || "hh:mm")
font.pointSize: 72
font.family: textFont.name
}
Text {
id: date
anchors.horizontalCenter: parent.horizontalCenter
color: clock.color
text : Qt.formatDate(clock.dateTime, Qt.DefaultLocaleLongDate)
font.family: textFont.name
font.pointSize: 24
}
}
Rectangle {
id: login_container
y: clock.y + clock.height + 30

View File

@@ -6,6 +6,7 @@ background_img_night=background.jpg
background_vid_day=playlists/day.m3u
background_vid_night=playlists/night.m3u
displayFont="Droid Sans Mono for Powerline"
timeFormat="hh:mm"
showLoginButton=true
passwordLeftMargin=15
usernameLeftMargin=15