allow configuring time format on theme.conf
This commit is contained in:
31
Main.qml
31
Main.qml
@@ -204,15 +204,38 @@ Rectangle {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
Clock {
|
Column {
|
||||||
id: clock
|
id: clock
|
||||||
|
property date dateTime: new Date()
|
||||||
|
property color color: "white"
|
||||||
y: parent.height * config.relativePositionY - clock.height / 2
|
y: parent.height * config.relativePositionY - clock.height / 2
|
||||||
x: parent.width * config.relativePositionX - clock.width / 2
|
x: parent.width * config.relativePositionX - clock.width / 2
|
||||||
color: "white"
|
|
||||||
timeFont.family: textFont.name
|
Timer {
|
||||||
dateFont.family: textFont.name
|
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 {
|
Rectangle {
|
||||||
id: login_container
|
id: login_container
|
||||||
y: clock.y + clock.height + 30
|
y: clock.y + clock.height + 30
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ background_img_night=background.jpg
|
|||||||
background_vid_day=playlists/day.m3u
|
background_vid_day=playlists/day.m3u
|
||||||
background_vid_night=playlists/night.m3u
|
background_vid_night=playlists/night.m3u
|
||||||
displayFont="Droid Sans Mono for Powerline"
|
displayFont="Droid Sans Mono for Powerline"
|
||||||
|
timeFormat="hh:mm"
|
||||||
showLoginButton=true
|
showLoginButton=true
|
||||||
passwordLeftMargin=15
|
passwordLeftMargin=15
|
||||||
usernameLeftMargin=15
|
usernameLeftMargin=15
|
||||||
|
|||||||
Reference in New Issue
Block a user