diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-18 11:42:16 +0800 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-18 11:42:16 +0800 |
| commit | c6a389120d8f1eebcc817d2903aae5ebb2b8732b (patch) | |
| tree | 97f913626275123f8bb2ac94b5778f89a0691160 /modules/dashboard | |
| parent | dashboard: m3 tab line (diff) | |
| download | caelestia-shell-c6a389120d8f1eebcc817d2903aae5ebb2b8732b.tar.gz caelestia-shell-c6a389120d8f1eebcc817d2903aae5ebb2b8732b.tar.bz2 caelestia-shell-c6a389120d8f1eebcc817d2903aae5ebb2b8732b.zip | |
dashboard: add datetime
Diffstat (limited to 'modules/dashboard')
| -rw-r--r-- | modules/dashboard/Dash.qml | 8 | ||||
| -rw-r--r-- | modules/dashboard/dash/DateTime.qml | 73 |
2 files changed, 76 insertions, 5 deletions
diff --git a/modules/dashboard/Dash.qml b/modules/dashboard/Dash.qml index 2d768c7..0d8b760 100644 --- a/modules/dashboard/Dash.qml +++ b/modules/dashboard/Dash.qml @@ -26,11 +26,9 @@ GridLayout { } Rect { - text: "time" - Layout.row: 1 - Layout.preferredWidth: 100 - Layout.fillHeight: true + + DateTime {} } Rect { @@ -40,7 +38,7 @@ GridLayout { Layout.column: 1 Layout.columnSpan: 3 Layout.fillWidth: true - Layout.preferredHeight: 200 + Layout.fillHeight: true } Rect { diff --git a/modules/dashboard/dash/DateTime.qml b/modules/dashboard/dash/DateTime.qml new file mode 100644 index 0000000..0c851fb --- /dev/null +++ b/modules/dashboard/dash/DateTime.qml @@ -0,0 +1,73 @@ +import "root:/widgets" +import "root:/services" +import "root:/config" +import Quickshell +import Quickshell.Io +import Quickshell.Widgets +import QtQuick + +Item { + id: root + + implicitWidth: DashboardConfig.sizes.dateTimeWidth + implicitHeight: date.y + date.implicitHeight + Appearance.padding.large * 2 + + StyledText { + id: hours + + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + anchors.topMargin: Appearance.padding.large * 2 + + horizontalAlignment: Text.AlignHCenter + text: Time.format("HH") + color: Colours.palette.m3secondary + font.pointSize: Appearance.font.size.extraLarge + font.weight: 500 + } + + StyledText { + id: sep + + anchors.left: parent.left + anchors.right: parent.right + anchors.top: hours.bottom + anchors.topMargin: -font.pointSize * 0.5 + + horizontalAlignment: Text.AlignHCenter + text: "•••" + color: Colours.palette.m3primary + font.pointSize: Appearance.font.size.extraLarge * 0.9 + } + + StyledText { + id: mins + + anchors.left: parent.left + anchors.right: parent.right + anchors.top: sep.bottom + anchors.topMargin: -sep.font.pointSize * 0.45 + + horizontalAlignment: Text.AlignHCenter + text: Time.format("MM") + color: Colours.palette.m3secondary + font.pointSize: Appearance.font.size.extraLarge + font.weight: 500 + } + + StyledText { + id: date + + anchors.left: parent.left + anchors.right: parent.right + anchors.top: mins.bottom + anchors.topMargin: Appearance.spacing.normal + + horizontalAlignment: Text.AlignHCenter + text: Time.format("ddd, d") + color: Colours.palette.m3tertiary + font.pointSize: Appearance.font.size.normal + font.weight: 500 + } +} |