quickshell-config/ClockWidget.qml

39 lines
756 B
QML
Raw Permalink Normal View History

2025-05-03 13:04:07 +02:00
import QtQuick
import QtQuick.Layouts
2025-05-06 09:38:56 +02:00
import Quickshell
2025-05-03 13:04:07 +02:00
Rectangle {
width: parent.width
2025-05-06 10:30:18 +02:00
height: text.height + 10
2025-05-03 13:04:07 +02:00
border.color: "black"
2025-05-06 10:30:18 +02:00
border.width: 2
2025-05-03 13:04:07 +02:00
radius: 5
2025-05-06 10:30:18 +02:00
color: "#30c0ffff"
2025-05-03 13:04:07 +02:00
Item {
width: parent.width
height: text.height * 2
anchors.centerIn: parent
2025-05-06 09:38:56 +02:00
SystemClock {
id: clock
precision: SystemClock.Seconds
}
2025-05-03 13:04:07 +02:00
Text {
id: text
anchors.centerIn: parent
property var date: Date()
2025-05-06 10:30:18 +02:00
text: Qt.formatDateTime(clock.date, "hh\nmm")
2025-05-03 13:04:07 +02:00
2025-05-06 10:30:18 +02:00
font.family: "ComicShannsMono Nerd Font Mono"
2025-05-03 13:04:07 +02:00
font.weight: Font.ExtraBold
font.pointSize: 18
color: "black"
}
}
}