37 lines
832 B
QML
37 lines
832 B
QML
import QtQuick
|
|
import Quickshell
|
|
import Quickshell.Hyprland
|
|
import "../../../colors"
|
|
|
|
Rectangle { //workspace
|
|
width: timeDisplay.width + 16
|
|
height: timeDisplay.height + 16
|
|
radius: 4
|
|
color: Colors.tertiaryContainer
|
|
border.color: Colors.tertiaryContainer_fg
|
|
border.width: 2
|
|
|
|
Text {
|
|
id: timeDisplay
|
|
|
|
property string currentTime: ""
|
|
|
|
text: currentTime
|
|
color: Colors.tertiary
|
|
font.pixelSize: 18
|
|
font.family: "Inter, sans-serif"
|
|
|
|
anchors.centerIn: parent
|
|
|
|
//Update time every second
|
|
Timer {
|
|
interval: 1000
|
|
running: true
|
|
repeat: true
|
|
onTriggered: {
|
|
var now = new Date()
|
|
timeDisplay.currentTime = Qt.formatTime(now, "hh:mm:ss")
|
|
}
|
|
}
|
|
}
|
|
} |