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-27 10:42:08 +0800
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-27 10:42:08 +0800
commit63da636144635e5aa6b7ff1a2d2eec2a1e35aafa (patch)
treecd5461058c7afedb2d17f474f13ee218759519ba /modules/bar/components/Clock.qml
parentdrawers: dont use hyprland cursor pos (diff)
downloadcaelestia-shell-63da636144635e5aa6b7ff1a2d2eec2a1e35aafa.tar.gz
caelestia-shell-63da636144635e5aa6b7ff1a2d2eec2a1e35aafa.tar.bz2
caelestia-shell-63da636144635e5aa6b7ff1a2d2eec2a1e35aafa.zip
internal: bar only vertical
The bar can only be vertical Remove box, boxlayout and anchortext Add StyledClippingRect
Diffstat (limited to 'modules/bar/components/Clock.qml')
-rw-r--r--modules/bar/components/Clock.qml14
1 files changed, 6 insertions, 8 deletions
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