Fix for Calendar days
This commit is contained in:
parent
b2fb868cd7
commit
c8aec206f2
1 changed files with 21 additions and 11 deletions
|
|
@ -75,20 +75,29 @@ NLoader {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Columns label (Sunday to Saturday)
|
// Columns label (Monday to Sunday)
|
||||||
DayOfWeekRow {
|
RowLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
spacing: 0
|
|
||||||
Layout.leftMargin: Style.marginSmall * scaling // Align with grid
|
Layout.leftMargin: Style.marginSmall * scaling // Align with grid
|
||||||
Layout.rightMargin: Style.marginSmall * scaling
|
Layout.rightMargin: Style.marginSmall * scaling
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
delegate: NText {
|
Repeater {
|
||||||
text: shortName
|
model: 7
|
||||||
color: Colors.accentSecondary
|
|
||||||
font.pointSize: Style.fontSizeMedium * scaling
|
NText {
|
||||||
font.weight: Style.fontWeightBold
|
text: {
|
||||||
horizontalAlignment: Text.AlignHCenter
|
// Start with Monday (1) instead of Sunday (0)
|
||||||
width: Style.baseWidgetSize * scaling
|
let dayIndex = (index + 1) % 7
|
||||||
|
return Qt.locale().dayName(dayIndex, Locale.ShortFormat)
|
||||||
|
}
|
||||||
|
color: Colors.accentSecondary
|
||||||
|
font.pointSize: Style.fontSizeMedium * scaling
|
||||||
|
font.weight: Style.fontWeightBold
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredWidth: Style.baseWidgetSize * scaling
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -102,6 +111,7 @@ NLoader {
|
||||||
spacing: 0
|
spacing: 0
|
||||||
month: Time.date.getMonth()
|
month: Time.date.getMonth()
|
||||||
year: Time.date.getFullYear()
|
year: Time.date.getFullYear()
|
||||||
|
locale: Qt.locale() // Use system locale
|
||||||
|
|
||||||
// Optionally, update when the panel becomes visible
|
// Optionally, update when the panel becomes visible
|
||||||
Connections {
|
Connections {
|
||||||
|
|
@ -140,4 +150,4 @@ NLoader {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue