refactor: bar clock use anchors

This commit is contained in:
2 * r + 2 * t 2025-04-29 10:56:44 +10:00
parent 01d9c31859
commit 398c508f99

View file

@ -4,27 +4,25 @@ import "root:/config"
import QtQuick
import QtQuick.Layouts
BoxLayout {
StyledRect {
id: root
readonly property color colour: Appearance.colours.peach
padding: [Appearance.padding.smaller, 0]
MaterialIcon {
id: icon
text: "calendar_month"
color: root.colour
Layout.alignment: Layout.Center
}
StyledText {
AnchorText {
prevAnchor: icon
horizontalAlignment: StyledText.AlignHCenter
text: root.vertical ? Time.format("hh\nmm") : Time.format("dd/MM/yy hh:mm")
font.pointSize: Appearance.font.size.smaller
font.family: Appearance.font.family.mono
color: root.colour
Layout.alignment: Layout.Center
}
}