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
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user