Commit 474447be authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Make set filters persist across view changes

parent 5fb5f45a
......@@ -45,7 +45,7 @@ GridLayout {
text: !headerLayout.todoMode ? i18n("Filtering by tags") : headerLayout.filterCollectionDetails && headerLayout.filter.collectionId > -1 ?
headerLayout.filterCollectionDetails.displayName : i18n("All Tasks")
font.weight: !headerLayout.todoMode ? Font.Normal : Font.Bold
color: headerLayout.filterCollectionDetails && headerLayout.filter.collectionId > -1 ?
color: headerLayout.todoMode && headerLayout.filterCollectionDetails && headerLayout.filter.collectionId > -1 ?
LabelUtils.getIncidenceLabelColor(headerLayout.filterCollectionDetails.color, headerLayout.isDark) : Kirigami.Theme.textColor
elide: Text.ElideRight
level: headerLayout.todoMode ? 1 : 2
......@@ -75,7 +75,7 @@ GridLayout {
implicitWidth: itemLayout.implicitWidth > tagFlow.width ?
tagFlow.width : itemLayout.implicitWidth
isHeading: true
headingItem.color: headerLayout.filterCollectionDetails ?
headingItem.color: headerLayout.todoMode && headerLayout.filterCollectionDetails ?
LabelUtils.getIncidenceLabelColor(headerLayout.filterCollectionDetails.color, headerLayout.isDark) : Kirigami.Theme.textColor
icon.name: "edit-delete-remove"
......
......@@ -25,7 +25,9 @@ Kirigami.Page {
property date startDate
property date currentDate
property date firstDayOfMonth
property var filter
property var filter: {
"tags": []
}
property int month
property int year
property bool initialMonth: true
......
......@@ -21,7 +21,9 @@ Kirigami.Page {
signal addSubTodo(var parentWrapper)
property var openOccurrence
property var filter
property var filter: {
"tags": []
}
property date selectedDate: new Date()
property date startDate: DateUtils.getFirstDayOfMonth(selectedDate)
property int day: selectedDate.getDate()
......
......@@ -22,7 +22,9 @@ Kirigami.Page {
signal addSubTodo(var parentWrapper)
property var openOccurrence: {}
property var filter
property var filter: {
"tags": []
}
property date selectedDate: new Date()
property date startDate: DateUtils.getFirstDayOfMonth(selectedDate)
property date currentDate: new Date() // Needs to get updated for marker to move, done from main.qml
......
......@@ -75,28 +75,34 @@ Kirigami.ApplicationWindow {
}
}
function switchView(newViewComponent) {
let filterCache = pageStack.currentItem.filter;
pageStack.pop(null);
pageStack.replace(newViewComponent);
pageStack.currentItem.filter = filterCache;
if(filterHeader.active) {
pageStack.currentItem.header = filterHeader.item;
}
}
Connections {
target: KalendarApplication
function onOpenMonthView() {
pageStack.pop(null);
pageStack.replace(monthViewComponent);
root.switchView(monthViewComponent);
}
function onOpenWeekView() {
pageStack.pop(null);
pageStack.replace(weekViewComponent);
root.switchView(weekViewComponent);
}
function onOpenScheduleView() {
pageStack.pop(null);
pageStack.replace(scheduleViewComponent);
root.switchView(scheduleViewComponent);
}
function onOpenTodoView() {
pageStack.pop(null);
pageStack.replace(todoPageComponent);
filterHeader.active = true;
pageStack.currentItem.header = filterHeader.item;
root.switchView(todoPageComponent);
}
function onOpenAboutPage() {
......
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