From bbc8fcaefa1cc4c8dafb4d1453990154c7b00d3c Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 5 Aug 2018 12:21:13 +0200 Subject: A calendar filter --- views/calendar/qml/View.qml | 7 +++++-- views/calendar/qml/WeekView.qml | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'views/calendar') diff --git a/views/calendar/qml/View.qml b/views/calendar/qml/View.qml index 3fc5d021..ac446b88 100644 --- a/views/calendar/qml/View.qml +++ b/views/calendar/qml/View.qml @@ -120,7 +120,8 @@ RowLayout { } spacing: Kube.Units.smallSpacing Repeater { - model: Kube.EntityModel { + model: Kube.CheckableEntityModel { + id: calendarModel type: "calendar" roles: ["name", "color"] } @@ -131,7 +132,8 @@ RowLayout { spacing: Kube.Units.smallSpacing Kube.CheckBox { opacity: 0.9 - checked: true + checked: model.checked + onToggled: model.checked = checked } Kube.Label { text: model.name @@ -158,5 +160,6 @@ RowLayout { Layout.fillWidth: true currentDate: root.currentDate startDate: root.selectedDate + calendarFilter: calendarModel.checkedEntities } } diff --git a/views/calendar/qml/WeekView.qml b/views/calendar/qml/WeekView.qml index 980ec432..2d16b772 100644 --- a/views/calendar/qml/WeekView.qml +++ b/views/calendar/qml/WeekView.qml @@ -30,6 +30,7 @@ FocusScope { property var hourHeight: Kube.Units.gridUnit * 2 property date currentDate property date startDate: currentDate + property var calendarFilter Item { anchors { @@ -94,6 +95,7 @@ FocusScope { model: Kube.DayLongEventModel { start: root.startDate length: root.daysToShow + calendarFilter: root.calendarFilter } delegate: Item { @@ -181,6 +183,7 @@ FocusScope { model: Kube.PeriodDayEventModel { start: root.startDate length: root.daysToShow + calendarFilter: root.calendarFilter } delegate: Rectangle { id: dayDelegate -- cgit v1.2.3