mirror of
https://github.com/AquaMorph/dotfiles.git
synced 2026-09-29 20:04:21 +00:00
refactor(quickshell): split bar components
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user