This commit is contained in:
pika 2025-06-16 12:13:50 +02:00
parent 9c3a3e06b2
commit 54c526f548

View file

@ -102,85 +102,113 @@ Column {
} }
} }
// Time and Date header // Date display section
Column { Row {
anchors.horizontalCenter: parent.horizontalCenter anchors.left: parent.left
spacing: Appearance.spacing.small anchors.leftMargin: 12
spacing: Appearance.spacing.normal
// Today's date
StyledText { StyledText {
anchors.horizontalCenter: parent.horizontalCenter text: Qt.formatDateTime(new Date(), "dd MMM yyyy")
text: root.currentTime font.pointSize: Appearance.font.size.small
font.pointSize: Appearance.font.size.larger
font.family: Appearance.font.family.mono font.family: Appearance.font.family.mono
} }
// Arrow and selected date (when applicable)
Row { Row {
anchors.horizontalCenter: parent.horizontalCenter visible: root.hasSelection
spacing: Appearance.spacing.small spacing: Appearance.spacing.small
Row { StyledText {
spacing: Appearance.spacing.small text: "→"
font.pointSize: Appearance.font.size.small
color: Colours.palette.m3onSurfaceVariant
}
MaterialIcon { StyledText {
text: "chevron_left" text: Qt.formatDateTime(root.selectedStartDate, "dd MMM yyyy")
color: Colours.palette.m3onSurfaceVariant font.pointSize: Appearance.font.size.small
MouseArea { font.family: Appearance.font.family.mono
anchors.fill: parent color: Colours.palette.m3primary
onClicked: { }
root.currentYear-- }
root.currentDate = new Date(root.currentYear, monthView.currentIndex, 1) }
}
}
}
StyledText { // Time display
text: root.currentYear StyledText {
font.pointSize: Appearance.font.size.large anchors.horizontalCenter: parent.horizontalCenter
font.weight: 700 text: root.currentTime
} font.pointSize: Appearance.font.size.larger
font.family: Appearance.font.family.mono
}
MaterialIcon { Row {
text: "chevron_right" anchors.horizontalCenter: parent.horizontalCenter
color: Colours.palette.m3onSurfaceVariant spacing: Appearance.spacing.small
MouseArea {
anchors.fill: parent Row {
onClicked: { spacing: Appearance.spacing.small
root.currentYear++
root.currentDate = new Date(root.currentYear, monthView.currentIndex, 1) 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 { StyledText {
spacing: Appearance.spacing.small text: root.currentYear
font.pointSize: Appearance.font.size.large
font.weight: 700
}
MaterialIcon { MaterialIcon {
text: "chevron_left" text: "chevron_right"
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
monthView.decrementCurrentIndex() root.currentYear++
} root.currentDate = new Date(root.currentYear, monthView.currentIndex, 1)
} }
} }
}
}
StyledText { Row {
text: Qt.formatDateTime(root.currentDate, "MMMM") spacing: Appearance.spacing.small
font.pointSize: Appearance.font.size.large
font.weight: 400 MaterialIcon {
color: Colours.palette.m3onSurfaceVariant text: "chevron_left"
color: Colours.palette.m3onSurfaceVariant
MouseArea {
anchors.fill: parent
onClicked: {
monthView.decrementCurrentIndex()
}
} }
}
MaterialIcon { StyledText {
text: "chevron_right" text: Qt.formatDateTime(root.currentDate, "MMMM")
color: Colours.palette.m3onSurfaceVariant font.pointSize: Appearance.font.size.large
MouseArea { font.weight: 400
anchors.fill: parent color: Colours.palette.m3onSurfaceVariant
onClicked: { }
monthView.incrementCurrentIndex()
} MaterialIcon {
text: "chevron_right"
color: Colours.palette.m3onSurfaceVariant
MouseArea {
anchors.fill: parent
onClicked: {
monthView.incrementCurrentIndex()
} }
} }
} }