Commit 48b4cd9f authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Add month grid mode to config



Signed-off-by: Claudio Cambra's avatarClaudio Cambra <claudio.cambra@gmail.com>
parent 0c1a88ae
......@@ -27,7 +27,15 @@ Kirigami.Page {
property bool dragDropEnabled: true
property alias dayGrid: swipeableViewLoader.item
readonly property var dayGrid: {
switch (Kalendar.Config.monthGridMode) {
case Kalendar.Config.BasicMonthGrid:
return basicViewLoader.item;
case Kalendar.Config.SwipeableMonthGrid:
default:
return swipeableViewLoader.item;
}
}
function setToDate(date, isInitialMonth = false) {
dayGrid.setToDate(date, isInitialMonth);
......@@ -70,7 +78,7 @@ Kirigami.Page {
Loader {
id: swipeableViewLoader
anchors.fill: parent
active: true
active: Kalendar.Config.monthGridMode === Kalendar.Config.SwipeableMonthGrid
sourceComponent: SwipeableMonthGridView {
anchors.fill: parent
......@@ -93,7 +101,7 @@ Kirigami.Page {
Loader {
id: basicViewLoader
anchors.fill: parent
active: false
active: Kalendar.Config.monthGridMode === Kalendar.Config.BasicMonthGrid
sourceComponent: BasicMonthGridView {
anchors.fill: parent
......
......@@ -70,8 +70,43 @@ Kirigami.ScrollablePage {
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormCardHeader {
title: i18n("Month View settings")
title: i18n("Month view settings")
}
Controls.ButtonGroup {
id: monthGridModeGroup
exclusive: true
onCheckedButtonChanged: {
Config.monthGridMode = checkedButton.value;
Config.save();
}
}
MobileForm.FormSectionText {
text: i18n("Month view mode")
}
ColumnLayout {
spacing: 0
Layout.fillWidth: true
MobileForm.FormRadioDelegate {
property int value: Config.SwipeableMonthGrid
text: i18n("Swipeable month grid")
enabled: !Config.isMonthGridModeImmutable
checked: Config.monthGridMode === value
Controls.ButtonGroup.group: monthGridModeGroup
}
MobileForm.FormRadioDelegate {
property int value: Config.BasicMonthGrid
text: i18n("Basic month grid")
enabled: !Config.isMonthGridModeImmutable
checked: Config.monthGridMode === value
Controls.ButtonGroup.group: monthGridModeGroup
}
MobileForm.FormTextDelegate {
text: i18n("Swipeable month grid requires higher system performance.")
visible: Config.monthGridMode === Config.SwipeableMonthGrid
}
}
Controls.ButtonGroup {
id: weekdayLabelGroup
exclusive: true
......
......@@ -92,6 +92,19 @@ SPDX-License-Identifier: LGPL-2.0-or-later
</entry>
</group>
<group name="MonthView">
<entry name="monthGridMode" type="Enum">
<label>Type of day grid view to be used internally in the month view"</label>
<choices>
<choice name="SwipeableMonthGrid">
<label>Swipeable month grid</label>
</choice>
<choice name="BasicMonthGrid">
<label>Basic month grid</label>
</choice>
</choices>
<default>SwipeableMonthGrid</default>
</entry>
<entry name="weekdayLabelAlignment" type="Enum">
<label>Alignment of week day header in month view.</label>
<choices>
......
Supports Markdown
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