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

Add BasicMonthListView



Signed-off-by: Claudio Cambra's avatarClaudio Cambra <claudio.cambra@gmail.com>
parent d930ffa6
This diff is collapsed.
......@@ -26,7 +26,7 @@ Kirigami.Page {
property bool dragDropEnabled: true
readonly property int mode: Kalendar.KalendarApplication.Schedule
readonly property var dayList: swipeableViewLoader.item
readonly property var dayList: basicViewLoader.item
readonly property Kirigami.Action previousAction: Kirigami.Action {
icon.name: "go-previous"
......@@ -46,12 +46,12 @@ Kirigami.Page {
icon.name: "go-jump-today"
text: i18n("Today")
shortcut: StandardKey.MoveToStartOfLine
onTriggered: setToDate(new Date())
onTriggered: setToDate(new Date(), true)
}
function setToDate(date, isInitialMonth = false) {
initialMonth = isInitialMonth;
dayList.setToDate(date);
dayList.setToDate(date, isInitialMonth);
}
Kirigami.Theme.inherit: false
......@@ -72,6 +72,7 @@ Kirigami.Page {
Loader {
id: swipeableViewLoader
anchors.fill: parent
active: false
sourceComponent: SwipeableMonthListView {
anchors.fill: parent
initialMonth: root.initialMonth
......@@ -83,4 +84,20 @@ Kirigami.Page {
onStartDateChanged: root.startDate = startDate
}
}
Loader {
id: basicViewLoader
anchors.fill: parent
active: true
sourceComponent: BasicMonthListView {
anchors.fill: parent
initialMonth: root.initialMonth
openOccurrence: root.openOccurrence
currentDate: root.currentDate
startDate: root.startDate
dragDropEnabled: root.dragDropEnabled
onStartDateChanged: root.startDate = startDate
}
}
}
......@@ -1034,7 +1034,7 @@ Kirigami.ApplicationWindow {
titleDateButton.date: scheduleView.startDate
titleDateButton.onClicked: dateChangeDrawer.active = !dateChangeDrawer.active
}
currentDate: root.selectedDate
currentDate: root.currentDate
openOccurrence: root.openOccurrence
onMonthChanged: if(month !== root.selectedDate.getMonth() && !initialMonth) root.selectedDate = new Date (year, month, 1)
......
......@@ -23,6 +23,7 @@ SPDX-License-Identifier: CC0-1.0
<file alias="BasicMonthGridView.qml">contents/ui/MainViews/BasicMonthGridView.qml</file>
<file alias="MonthView.qml">contents/ui/MainViews/MonthView.qml</file>
<file alias="SwipeableMonthListView.qml">contents/ui/MainViews/SwipeableMonthListView.qml</file>
<file alias="BasicMonthListView.qml">contents/ui/MainViews/BasicMonthListView.qml</file>
<file alias="ScheduleView.qml">contents/ui/MainViews/ScheduleView.qml</file>
<file alias="TodoTreeView.qml">contents/ui/MainViews/TodoTreeView.qml</file>
<file alias="TodoView.qml">contents/ui/MainViews/TodoView.qml</file>
......
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