Commit a82927cb authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Add week view mode to config



Signed-off-by: Claudio Cambra's avatarClaudio Cambra <claudio.cambra@gmail.com>
parent a9012d63
......@@ -27,7 +27,15 @@ Kirigami.Page {
property int daysToShow: 7
property bool dragDropEnabled: true
readonly property var internalHourlyView: basicViewLoader.item
readonly property var internalHourlyView: {
switch (Kalendar.Config.hourlyViewMode) {
case Kalendar.Config.BasicInternalHourlyView:
return basicViewLoader.item;
case Kalendar.Config.SwipeableInternalHourlyView:
default:
return swipeableViewLoader.item;
}
}
readonly property var mode: switch(daysToShow) {
case 1:
......@@ -83,7 +91,7 @@ Kirigami.Page {
Loader {
id: swipeableViewLoader
anchors.fill: parent
active: false
active: Kalendar.Config.hourlyViewMode === Kalendar.Config.SwipeableInternalHourlyView
sourceComponent: SwipeableInternalHourlyView {
anchors.fill: parent
......@@ -100,7 +108,7 @@ Kirigami.Page {
Loader {
id: basicViewLoader
anchors.fill: parent
active: true
active: Kalendar.Config.hourlyViewMode === Kalendar.Config.BasicInternalHourlyView
sourceComponent: BasicInternalHourlyView {
anchors.fill: parent
......
......@@ -216,6 +216,51 @@ Kirigami.ScrollablePage {
}
}
MobileForm.FormCard {
Layout.fillWidth: true
Layout.topMargin: Kirigami.Units.largeSpacing
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormCardHeader {
title: i18n("Week view settings")
}
Controls.ButtonGroup {
id: hourlyViewModeGroup
exclusive: true
onCheckedButtonChanged: {
Config.hourlyViewMode = checkedButton.value;
Config.save();
}
}
MobileForm.FormSectionText {
text: i18n("Week view mode")
}
ColumnLayout {
spacing: 0
Layout.fillWidth: true
MobileForm.FormRadioDelegate {
property int value: Config.SwipeableInternalHourlyView
text: i18n("Swipeable week view")
enabled: !Config.isHourlyViewModeImmutable
checked: Config.monthGridMode === value
Controls.ButtonGroup.group: hourlyViewModeGroup
}
MobileForm.FormRadioDelegate {
property int value: Config.BasicInternalHourlyView
text: i18n("Basic week view")
enabled: !Config.isHourlyViewModeImmutable
checked: Config.monthGridMode === value
Controls.ButtonGroup.group: hourlyViewModeGroup
}
MobileForm.FormTextDelegate {
text: i18n("Swipeable week view requires higher system performance.")
visible: Config.hourlyViewMode === Config.SwipeableInternalHourlyView
}
}
}
}
MobileForm.FormCard {
Layout.fillWidth: true
Layout.topMargin: Kirigami.Units.largeSpacing
......
......@@ -149,6 +149,19 @@ SPDX-License-Identifier: LGPL-2.0-or-later
</group>
<group name="WeekView">
<entry name="hourlyViewMode" type="Enum">
<label>Type of day grid view to be used internally in the month view"</label>
<choices>
<choice name="SwipeableInternalHourlyView">
<label>Swipeable internal week view</label>
</choice>
<choice name="BasicInternalHourlyView">
<label>Basic internal week view</label>
</choice>
</choices>
<default>SwipeableMonthGrid</default>
</entry>
<entry name="weekViewAllDayHeaderHeight" type="Int">
<label>Set the height of the all-day header at the top of the week view."</label>
<default>-1</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