summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorRémi Nicole <nicole@kolabsystems.com>2018-04-17 14:30:27 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-04-17 14:32:29 +0200
commitb8d76329bced92d712185e5588dfd6061e8fe0f6 (patch)
treeaf37569d19c112549ab1e6ba0b94fe9c2d83c4fc /views
parentafaaeb6dc16315c78091653a2662be41781ddfd3 (diff)
downloadkube-b8d76329bced92d712185e5588dfd6061e8fe0f6.tar.gz
kube-b8d76329bced92d712185e5588dfd6061e8fe0f6.zip
Implement PeriodDayEventModel
Summary: Implements a model to load events. When finished, should fix T8225 TODO: - Use the parent / children model in qml, instead of relying on the ".events" attribute (using DelegateModel I think) Reviewers: cmollekopf Tags: #kube Maniphest Tasks: T8225 Differential Revision: https://phabricator.kde.org/D12089
Diffstat (limited to 'views')
-rw-r--r--views/calendar/qml/WeekEvents.qml95
-rw-r--r--views/calendar/qml/WeekView.qml12
2 files changed, 11 insertions, 96 deletions
diff --git a/views/calendar/qml/WeekEvents.qml b/views/calendar/qml/WeekEvents.qml
index 005fb19e..774f254e 100644
--- a/views/calendar/qml/WeekEvents.qml
+++ b/views/calendar/qml/WeekEvents.qml
@@ -1,93 +1,8 @@
1import QtQuick 2.7 1import QtQuick 2.7
2 2
3ListModel { 3import org.kube.framework 1.0 as Kube
4 ListElement { 4
5 events: [ 5Kube.PeriodDayEventModel {
6 ListElement { 6 start: "2018-04-09"
7 color: "#af1a6a" 7 length: 7
8 starts: 1
9 duration: 4
10 text: "Meeting"
11 indention: 0
12 },
13 ListElement {
14 color: "#134bab"
15 starts: 9
16 duration: 5
17 text: "Sport"
18 indention: 0
19 }
20 ]
21 }
22 ListElement {
23 events: [
24 ListElement {
25 color: "#134bab"
26 starts: 9
27 duration: 5
28 text: "Sport"
29 indention: 0
30 }
31 ]
32 }
33 ListElement {
34 events: []
35 }
36 ListElement {
37 events: [
38 ListElement {
39 color: "#af1a6a"
40 starts: 1
41 duration: 4
42 indention: 0
43 text: "Meeting"
44 }
45 ]
46 }
47 ListElement {
48 events: [
49 ListElement {
50 color: "#134bab"
51 starts: 3
52 duration: 5
53 indention: 0
54 text: "Meeting"
55 },
56 ListElement {
57 color: "#af1a6a"
58 starts: 4
59 duration: 7
60 indention: 1
61 text: "Meeting2"
62 }
63 ]
64 }
65 ListElement {
66 events: [
67 ListElement {
68 color: "#134bab"
69 starts: 8
70 duration: 5
71 indention: 0
72 text: "Meeting"
73 },
74 ListElement {
75 color: "#af1a6a"
76 starts: 8
77 duration: 4
78 indention: 1
79 text: "Meeting2"
80 },
81 ListElement {
82 color: "#af1a6a"
83 starts: 9
84 duration: 7
85 indention: 2
86 text: "Meeting2"
87 }
88 ]
89 }
90 ListElement {
91 events: []
92 }
93} 8}
diff --git a/views/calendar/qml/WeekView.qml b/views/calendar/qml/WeekView.qml
index 8eef3a92..877500c5 100644
--- a/views/calendar/qml/WeekView.qml
+++ b/views/calendar/qml/WeekView.qml
@@ -212,12 +212,12 @@ FocusScope {
212 right: parent.right 212 right: parent.right
213 rightMargin: Kube.Units.smallSpacing 213 rightMargin: Kube.Units.smallSpacing
214 } 214 }
215 width: Kube.Units.gridUnit * 7 - Kube.Units.smallSpacing * 2 - Kube.Units.gridUnit * model.indention 215 width: Kube.Units.gridUnit * 7 - Kube.Units.smallSpacing * 2 - Kube.Units.gridUnit * model.modelData.indention
216 height: Kube.Units.gridUnit * model.duration 216 height: Kube.Units.gridUnit * model.modelData.duration
217 y: Kube.Units.gridUnit * model.starts 217 y: Kube.Units.gridUnit * model.modelData.starts
218 x: Kube.Units.gridUnit * model.indention 218 x: Kube.Units.gridUnit * model.modelData.indention
219 219
220 color: model.color 220 color: model.modelData.color
221 border.width: 1 221 border.width: 1
222 border.color: Kube.Colors.viewBackgroundColor 222 border.color: Kube.Colors.viewBackgroundColor
223 223
@@ -226,7 +226,7 @@ FocusScope {
226 left: parent.left 226 left: parent.left
227 leftMargin: Kube.Units.smallSpacing 227 leftMargin: Kube.Units.smallSpacing
228 } 228 }
229 text: model.text 229 text: model.modelData.text
230 color: Kube.Colors.highlightedTextColor 230 color: Kube.Colors.highlightedTextColor
231 } 231 }
232 232