Commit 3fded2b8 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇 Committed by Nate Graham

[Digital Clock] Add override for calendar first day of week

It drives me nuts that on my en_US locale computer the calendar starts with a Sunday.

CCBUG: 360965
parent 148a9d15
......@@ -65,6 +65,10 @@
<label>Force the clock to use 12/24 hour time, instead of following the user locale.</label>
<default>1</default>
</entry>
<entry name="firstDayOfWeek" type="Int">
<label>Force the calendar to use a specific week day as first day of a week. -1 means follow user locale, 0 is Sunday, 1 is Monday, etc.</label>
<default>-1</default>
</entry>
<entry name="enabledCalendarPlugins" type="StringList">
<label>A list of plugins where additional calendar event data can be sourced.</label>
<default></default>
......
......@@ -117,6 +117,9 @@ PlasmaComponents3.Page {
id: monthView
borderOpacity: 0.25
today: root.tzDate
firstDayOfWeek: plasmoid.configuration.firstDayOfWeek > -1
? plasmoid.configuration.firstDayOfWeek
: Qt.locale().firstDayOfWeek
showWeekNumbers: plasmoid.configuration.showWeekNumbers
}
}
......
......@@ -32,6 +32,7 @@ Item {
signal configurationChanged
property alias cfg_showWeekNumbers: showWeekNumbers.checked
property int cfg_firstDayOfWeek
function saveConfig()
{
......@@ -50,6 +51,26 @@ Item {
text: i18n("Show week numbers")
}
QtLayouts.RowLayout {
QtLayouts.Layout.fillWidth: true
Kirigami.FormData.label: i18n("First day of week:")
QtControls.ComboBox {
id: firstDayOfWeekCombo
textRole: "text"
model: [-1, 0, 1, 5, 6].map((day) => {
return {
day,
text: day === -1 ? i18n("Use Region Defaults") : Qt.locale().dayName(day)
};
})
onActivated: cfg_firstDayOfWeek = model[index].day
currentIndex: model.findIndex((item) => {
return item.day === cfg_firstDayOfWeek;
})
}
}
Item {
Kirigami.FormData.isSection: true
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment