summaryrefslogtreecommitdiff
path: root/bar/TimeDate.qml
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-08-01 17:48:51 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-08-01 17:48:51 +0800
commit27d998edff3c0847f082c9bf8e12da7b7a0518c6 (patch)
tree096735098285c6999ccbf5c3933669964c918548 /bar/TimeDate.qml
parenta657eab0468ef86b398e1612c2a3d5caf7328f1e (diff)
TimeDate: dynamic clock icon
Diffstat (limited to 'bar/TimeDate.qml')
-rw-r--r--bar/TimeDate.qml16
1 files changed, 9 insertions, 7 deletions
diff --git a/bar/TimeDate.qml b/bar/TimeDate.qml
index a7a1552..8e554ef 100644
--- a/bar/TimeDate.qml
+++ b/bar/TimeDate.qml
@@ -35,6 +35,11 @@ Item {
sourceComponent: !root.isAlt ? main : alt
readonly property Component main: Component {
RowLayout {
+ id: root
+ property int h: Services.TimeDate.hours
+ property int m: Services.TimeDate.minutes
+ property int s: Services.TimeDate.seconds
+
Item {
Layout.fillWidth: true
}
@@ -42,31 +47,28 @@ Item {
spacing: Bar.resourceIconTextSpacing
Icon {
- text: Icons.resource.clock
+ text: Icons.resource.clock[root.h - 1]
font.pixelSize: Style.font.size.larger
}
RowLayout {
- property int h: Services.TimeDate.hours
- property int m: Services.TimeDate.minutes
- property int s: Services.TimeDate.seconds
spacing: 0
IText {
animate: true
- text: (parent.h >= 10 ? "" : "0") + parent.h
+ text: (root.h >= 10 ? "" : "0") + root.h
}
IText {
text: ":"
}
IText {
animate: true
- text: (parent.m >= 10 ? "" : "0") + parent.m
+ text: (root.m >= 10 ? "" : "0") + root.m
}
IText {
text: ":"
}
IText {
animate: true
- text: (parent.s >= 10 ? "" : "0") + parent.s
+ text: (root.s >= 10 ? "" : "0") + root.s
renderType: Text.CurveRendering // it's not static and is rapidly updated
}
}