Made the current day of the month be colored in the accent color

This commit is contained in:
2025-12-15 01:18:03 +02:00
parent 1e3f7a988d
commit d1a8dc3ff8

View File

@@ -7,19 +7,16 @@ Flickable {
id: flickable
width: 200
height: 200
onDragStarted: console.info("Drag has started")
onDragEnded: console.info("Drag has ended")
GridLayout {
columns: 1
DayOfWeekRow {
locale: grid.locale
Layout.fillWidth: true
}
// We don't need a week column for the moment
// WeekNumberColumn {
// month: grid.month
// year: grid.year
@@ -35,6 +32,7 @@ Flickable {
// }
MonthGrid {
id: grid
month: Calendar.November
year: currentDate.getFullYear()
@@ -42,14 +40,24 @@ Flickable {
Layout.fillWidth: true
Layout.fillHeight: true
delegate: Text {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: model.day
color: model.month === currentDate.getMonth() ? myPalette.text : disabledPalette.text
delegate: Rectangle {
color: model.today ? "transparent": myPalette.accent
width: 30
height: 20
Text {
anchors.centerIn: parent
font.pixelSize: 12
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: model.day
color: model.month === currentDate.getMonth() ? myPalette.text : disabledPalette.text
}
required property var model
}
}
}
required property date currentDate
}