diff --git a/modules/bar/popouts/Calendar.qml b/modules/bar/popouts/Calendar.qml index 9c64d53..097f0bd 100644 --- a/modules/bar/popouts/Calendar.qml +++ b/modules/bar/popouts/Calendar.qml @@ -102,85 +102,113 @@ Column { } } - // Time and Date header - Column { - anchors.horizontalCenter: parent.horizontalCenter - spacing: Appearance.spacing.small + // Date display section + Row { + anchors.left: parent.left + anchors.leftMargin: 12 + spacing: Appearance.spacing.normal + // Today's date StyledText { - anchors.horizontalCenter: parent.horizontalCenter - text: root.currentTime - font.pointSize: Appearance.font.size.larger + text: Qt.formatDateTime(new Date(), "dd MMM yyyy") + font.pointSize: Appearance.font.size.small font.family: Appearance.font.family.mono } + // Arrow and selected date (when applicable) Row { - anchors.horizontalCenter: parent.horizontalCenter + visible: root.hasSelection spacing: Appearance.spacing.small - Row { - spacing: Appearance.spacing.small + StyledText { + text: "→" + font.pointSize: Appearance.font.size.small + color: Colours.palette.m3onSurfaceVariant + } - MaterialIcon { - text: "chevron_left" - color: Colours.palette.m3onSurfaceVariant - MouseArea { - anchors.fill: parent - onClicked: { - root.currentYear-- - root.currentDate = new Date(root.currentYear, monthView.currentIndex, 1) - } - } - } + StyledText { + text: Qt.formatDateTime(root.selectedStartDate, "dd MMM yyyy") + font.pointSize: Appearance.font.size.small + font.family: Appearance.font.family.mono + color: Colours.palette.m3primary + } + } + } - StyledText { - text: root.currentYear - font.pointSize: Appearance.font.size.large - font.weight: 700 - } + // Time display + StyledText { + anchors.horizontalCenter: parent.horizontalCenter + text: root.currentTime + font.pointSize: Appearance.font.size.larger + font.family: Appearance.font.family.mono + } - MaterialIcon { - text: "chevron_right" - color: Colours.palette.m3onSurfaceVariant - MouseArea { - anchors.fill: parent - onClicked: { - root.currentYear++ - root.currentDate = new Date(root.currentYear, monthView.currentIndex, 1) - } + Row { + anchors.horizontalCenter: parent.horizontalCenter + spacing: Appearance.spacing.small + + Row { + spacing: Appearance.spacing.small + + MaterialIcon { + text: "chevron_left" + color: Colours.palette.m3onSurfaceVariant + MouseArea { + anchors.fill: parent + onClicked: { + root.currentYear-- + root.currentDate = new Date(root.currentYear, monthView.currentIndex, 1) } } } - Row { - spacing: Appearance.spacing.small + StyledText { + text: root.currentYear + font.pointSize: Appearance.font.size.large + font.weight: 700 + } - MaterialIcon { - text: "chevron_left" - color: Colours.palette.m3onSurfaceVariant - MouseArea { - anchors.fill: parent - onClicked: { - monthView.decrementCurrentIndex() - } + MaterialIcon { + text: "chevron_right" + color: Colours.palette.m3onSurfaceVariant + MouseArea { + anchors.fill: parent + onClicked: { + root.currentYear++ + root.currentDate = new Date(root.currentYear, monthView.currentIndex, 1) } } + } + } - StyledText { - text: Qt.formatDateTime(root.currentDate, "MMMM") - font.pointSize: Appearance.font.size.large - font.weight: 400 - color: Colours.palette.m3onSurfaceVariant + Row { + spacing: Appearance.spacing.small + + MaterialIcon { + text: "chevron_left" + color: Colours.palette.m3onSurfaceVariant + MouseArea { + anchors.fill: parent + onClicked: { + monthView.decrementCurrentIndex() + } } + } - MaterialIcon { - text: "chevron_right" - color: Colours.palette.m3onSurfaceVariant - MouseArea { - anchors.fill: parent - onClicked: { - monthView.incrementCurrentIndex() - } + StyledText { + text: Qt.formatDateTime(root.currentDate, "MMMM") + font.pointSize: Appearance.font.size.large + font.weight: 400 + color: Colours.palette.m3onSurfaceVariant + } + + MaterialIcon { + text: "chevron_right" + color: Colours.palette.m3onSurfaceVariant + MouseArea { + anchors.fill: parent + onClicked: { + monthView.incrementCurrentIndex() } } }