From 63da636144635e5aa6b7ff1a2d2eec2a1e35aafa Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 27 May 2025 10:42:08 +0800 Subject: internal: bar only vertical The bar can only be vertical Remove box, boxlayout and anchortext Add StyledClippingRect --- modules/bar/components/Clock.qml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'modules/bar/components/Clock.qml') diff --git a/modules/bar/components/Clock.qml b/modules/bar/components/Clock.qml index a0fb267..ea57e2b 100644 --- a/modules/bar/components/Clock.qml +++ b/modules/bar/components/Clock.qml @@ -3,14 +3,12 @@ import "root:/services" import "root:/config" import QtQuick -Item { +Column { id: root - readonly property bool vertical: parent?.vertical ?? false property color colour: Colours.palette.m3tertiary - 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) + spacing: Appearance.spacing.small MaterialIcon { id: icon @@ -18,16 +16,16 @@ Item { text: "calendar_month" color: root.colour - anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined + anchors.horizontalCenter: parent.horizontalCenter } - AnchorText { + StyledText { id: text - prevAnchor: icon + anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: StyledText.AlignHCenter - text: root.vertical ? Time.format("hh\nmm") : Time.format("hh:mm • dddd, dd MMMM") + text: Time.format("hh\nmm") font.pointSize: Appearance.font.size.smaller font.family: Appearance.font.family.mono color: root.colour -- cgit v1.2.3-freya