summaryrefslogtreecommitdiff
path: root/modules/bar/components/Clock.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-24 13:31:36 +0800
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-24 13:31:36 +0800
commit01b38be6afbe660e3b9f9e136870a76afb69bf31 (patch)
treea18c46b9d8fb0261addeadb89ca2a8ebd22f0ccc /modules/bar/components/Clock.qml
parentdashboard: default weather (diff)
downloadcaelestia-shell-01b38be6afbe660e3b9f9e136870a76afb69bf31.tar.gz
caelestia-shell-01b38be6afbe660e3b9f9e136870a76afb69bf31.tar.bz2
caelestia-shell-01b38be6afbe660e3b9f9e136870a76afb69bf31.zip
internal: fix binding loops
Diffstat (limited to 'modules/bar/components/Clock.qml')
-rw-r--r--modules/bar/components/Clock.qml8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/bar/components/Clock.qml b/modules/bar/components/Clock.qml
index 3397222..bec7e30 100644
--- a/modules/bar/components/Clock.qml
+++ b/modules/bar/components/Clock.qml
@@ -3,11 +3,15 @@ import "root:/services"
import "root:/config"
import QtQuick
-StyledRect {
+Item {
id: root
+ readonly property bool vertical: parent?.vertical ?? false
property color colour: Colours.palette.peach
+ implicitWidth: vertical ? Math.max(icon.implicitWidth, text.implicitWidth) : icon.implicitWidth + text.implicitWidth + text.anchors.leftMargin
+ implicitHeight: vertical ? icon.implicitHeight + text.implicitHeight + text.anchors.topMargin : Math.max(icon.implicitHeight, text.implicitHeight)
+
MaterialIcon {
id: icon
@@ -18,6 +22,8 @@ StyledRect {
}
AnchorText {
+ id: text
+
prevAnchor: icon
horizontalAlignment: StyledText.AlignHCenter