refactor(quickshell): split bar components

This commit is contained in:
2026-09-25 17:41:59 -04:00
parent 4fdb6d90d8
commit 04cf13ae99
6 changed files with 225 additions and 180 deletions
@@ -0,0 +1,20 @@
Block {
id: root
required property var clock
property bool showSeconds: false
signal detailsRequested(var anchorItem)
function formattedTime() {
const date = clock.date;
const hour = date.getHours() % 12 || 12;
const minute = date.getMinutes().toString().padStart(2, "0");
const second = date.getSeconds().toString().padStart(2, "0");
return hour + ":" + minute + (showSeconds ? ":" + second : "");
}
interactive: true
text: formattedTime()
onClicked: detailsRequested(root)
onDoubleClicked: showSeconds = !showSeconds
}