Commit 80a8534c authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Add schedule view mode to config



Signed-off-by: Claudio Cambra's avatarClaudio Cambra <claudio.cambra@gmail.com>
parent de1cb66d
Pipeline #246421 canceled with stage
in 28 seconds
......@@ -26,7 +26,15 @@ Kirigami.Page {
property bool dragDropEnabled: true
readonly property int mode: Kalendar.KalendarApplication.Schedule
readonly property var dayList: basicViewLoader.item
readonly property var dayList: {
switch (Kalendar.Config.monthListMode) {
case Kalendar.Config.BasicMonthList:
return basicViewLoader.item;
case Kalendar.Config.SwipeableMonthList:
default:
return swipeableViewLoader.item;
}
}
readonly property Kirigami.Action previousAction: Kirigami.Action {
icon.name: "go-previous"
......@@ -72,7 +80,7 @@ Kirigami.Page {
Loader {
id: swipeableViewLoader
anchors.fill: parent
active: false
active: Kalendar.Config.monthListMode === Kalendar.Config.SwipeableMonthList
sourceComponent: SwipeableMonthListView {
anchors.fill: parent
initialMonth: root.initialMonth
......@@ -88,7 +96,7 @@ Kirigami.Page {
Loader {
id: basicViewLoader
anchors.fill: parent
active: true
active: Kalendar.Config.monthListMode === Kalendar.Config.BasicMonthList
sourceComponent: BasicMonthListView {
anchors.fill: parent
initialMonth: root.initialMonth
......
......@@ -269,6 +269,41 @@ Kirigami.ScrollablePage {
MobileForm.FormCardHeader {
title: i18n("Schedule View settings")
}
Controls.ButtonGroup {
id: monthListModeGroup
exclusive: true
onCheckedButtonChanged: {
Config.monthListMode = checkedButton.value;
Config.save();
}
}
MobileForm.FormSectionText {
text: i18n("Schedule view mode")
}
ColumnLayout {
spacing: 0
Layout.fillWidth: true
MobileForm.FormRadioDelegate {
property int value: Config.SwipeableMonthList
text: i18n("Swipeable schedule view")
enabled: !Config.isMonthListModeImmutable
checked: Config.monthListMode === value
Controls.ButtonGroup.group: monthListModeGroup
}
MobileForm.FormRadioDelegate {
property int value: Config.BasicMonthList
text: i18n("Basic schedule view")
enabled: !Config.isMonthListModeImmutable
checked: Config.monthListMode === value
Controls.ButtonGroup.group: monthListModeGroup
}
MobileForm.FormTextDelegate {
text: i18n("Swipeable schedule view requires higher system performance.")
visible: Config.monthListMode === Config.SwipeableMonthList
}
}
MobileForm.FormCheckDelegate {
text: i18n("Show week headers")
checked: Config.showWeekHeaders
......
......@@ -169,6 +169,19 @@ SPDX-License-Identifier: LGPL-2.0-or-later
</group>
<group name="ScheduleView">
<entry name="monthListMode" type="Enum">
<label>Type of day list view to be used internally in the schedule view"</label>
<choices>
<choice name="SwipeableMonthList">
<label>Swipeable internal month list view</label>
</choice>
<choice name="BasicMonthList">
<label>Basic internal month list view</label>
</choice>
</choices>
<default>SwipeableMonthList</default>
</entry>
<entry name="showWeekHeaders" type="Bool">
<label>Show week headers in schedule view.</label>
<default>true</default>
......
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