From 455809b0e5d6e80406867aa8f5a74aa10a39bf35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Nicole?= Date: Tue, 15 May 2018 12:01:09 +0200 Subject: Implement DayLongEventModel and integrate it to the calendar Summary: Fixes T8697 Reviewers: cmollekopf Reviewed By: cmollekopf Tags: #kube Maniphest Tasks: T8697 Differential Revision: https://phabricator.kde.org/D12875 --- views/calendar/main.qml | 59 +++++++++++++++++++++++++++++++++++- views/calendar/qml/DaylongEvents.qml | 18 +++-------- views/calendar/qml/WeekView.qml | 5 +-- 3 files changed, 66 insertions(+), 16 deletions(-) (limited to 'views') diff --git a/views/calendar/main.qml b/views/calendar/main.qml index 26898685..e3915e74 100644 --- a/views/calendar/main.qml +++ b/views/calendar/main.qml @@ -74,10 +74,67 @@ ApplicationWindow { { resource: "caldavresource", summary: "Test Event4", - description: "This is test event #3", + description: "This is test event #4", starts: "2018-04-12T22:00:00", ends: "2018-04-15T03:00:00", }, + { + resource: "caldavresource", + summary: "!!! Test Event5", + description: "!!! This is test event #5", + starts: "2018-04-22T22:00:00", + ends: "2018-04-25T03:00:00", + }, + + // Day-long events + { + resource: "caldavresource", + summary: "Test day-long event1", + description: "This is test day-long event #1", + starts: "2018-04-10T00:00:00", + ends: "2018-04-14T00:00:00", + allDay: true, + }, + { + resource: "caldavresource", + summary: "Test day-long event2", + description: "This is test day-long event #2", + starts: "2018-04-11T00:00:00", + ends: "2018-04-23T00:00:00", + allDay: true, + }, + { + resource: "caldavresource", + summary: "Test day-long event3", + description: "This is test day-long event #3", + starts: "2018-04-01T00:00:00", + ends: "2018-04-13T00:00:00", + allDay: true, + }, + { + resource: "caldavresource", + summary: "Test day-long event4", + description: "This is test day-long event #4", + starts: "2018-04-01T00:00:00", + ends: "2018-04-25T00:00:00", + allDay: true, + }, + { + resource: "caldavresource", + summary: "!!! Test day-long event5", + description: "!!! This is test day-long event #5", + starts: "2018-04-01T00:00:00", + ends: "2018-04-05T00:00:00", + allDay: true, + }, + { + resource: "caldavresource", + summary: "!!! Test day-long event6", + description: "!!! This is test day-long event #6", + starts: "2018-04-23T00:00:00", + ends: "2018-04-25T00:00:00", + allDay: true, + }, ], }], } diff --git a/views/calendar/qml/DaylongEvents.qml b/views/calendar/qml/DaylongEvents.qml index 340c9d79..a07b66dd 100644 --- a/views/calendar/qml/DaylongEvents.qml +++ b/views/calendar/qml/DaylongEvents.qml @@ -1,16 +1,8 @@ import QtQuick 2.7 -ListModel { - ListElement { - color: "#af1a6a" - starts: 1 - duration: 4 - text: "Baustelle Adalbertstr." - } - ListElement { - color: "#134bab" - starts: 0 - duration: 6 - text: "Urlaub" - } +import org.kube.framework 1.0 as Kube + +Kube.DayLongEventModel { + start: "2018-04-09" + length: 7 } diff --git a/views/calendar/qml/WeekView.qml b/views/calendar/qml/WeekView.qml index f798e489..bcf037fa 100644 --- a/views/calendar/qml/WeekView.qml +++ b/views/calendar/qml/WeekView.qml @@ -97,7 +97,8 @@ FocusScope { width: root.dayWidth * model.duration height: parent.height x: root.dayWidth * model.starts - color: model.color + //color: model.color + color: Kube.Colors.jazzberryJam border.width: 1 border.color: Kube.Colors.viewBackgroundColor @@ -107,7 +108,7 @@ FocusScope { leftMargin: Kube.Units.smallSpacing } color: Kube.Colors.highlightedTextColor - text: model.text + text: model.summary } } } -- cgit v1.2.3