summaryrefslogtreecommitdiff
path: root/modules/dashboard/dash/Calendar.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-20 22:01:42 +0800
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-20 22:01:42 +0800
commitc32d9035e035d5539a639b2f60314bd1002c107a (patch)
tree7d89ec483c392bca8e54c85a1a6a63ef5c808564 /modules/dashboard/dash/Calendar.qml
parentlauncher: limit width to less of screen (diff)
downloadcaelestia-shell-c32d9035e035d5539a639b2f60314bd1002c107a.tar.gz
caelestia-shell-c32d9035e035d5539a639b2f60314bd1002c107a.tar.bz2
caelestia-shell-c32d9035e035d5539a639b2f60314bd1002c107a.zip
dashboard: add calendar
Diffstat (limited to 'modules/dashboard/dash/Calendar.qml')
-rw-r--r--modules/dashboard/dash/Calendar.qml65
1 files changed, 65 insertions, 0 deletions
diff --git a/modules/dashboard/dash/Calendar.qml b/modules/dashboard/dash/Calendar.qml
new file mode 100644
index 0000000..ac31861
--- /dev/null
+++ b/modules/dashboard/dash/Calendar.qml
@@ -0,0 +1,65 @@
+import "root:/widgets"
+import "root:/services"
+import "root:/config"
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+
+ColumnLayout {
+ id: root
+
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: Appearance.padding.large
+ spacing: Appearance.spacing.small
+
+ DayOfWeekRow {
+ id: days
+
+ Layout.topMargin: Appearance.padding.large
+ Layout.fillWidth: true
+
+ font.family: Appearance.font.family.sans
+ font.weight: 500
+
+ // delegate: StyledText {}
+ }
+
+ MonthGrid {
+ id: grid
+
+ Layout.bottomMargin: Appearance.padding.large
+ Layout.fillWidth: true
+
+ spacing: 3
+
+ delegate: Item {
+ id: day
+
+ required property var model
+
+ implicitWidth: implicitHeight
+ implicitHeight: text.implicitHeight + Appearance.padding.small * 2
+
+ StyledRect {
+ anchors.centerIn: parent
+
+ implicitWidth: parent.implicitHeight
+ implicitHeight: parent.implicitHeight
+
+ radius: Appearance.rounding.full
+ color: model.today ? Colours.palette.m3primary : "transparent"
+
+ StyledText {
+ id: text
+
+ anchors.centerIn: parent
+
+ horizontalAlignment: Text.AlignHCenter
+ text: grid.locale.toString(day.model.date, "d")
+ color: day.model.today ? Colours.palette.m3onPrimary : day.model.month === grid.month ? Colours.palette.m3onSurface : Colours.palette.m3outline
+ }
+ }
+ }
+ }
+}