diff options
Diffstat (limited to 'views/calendar/qml/View.qml')
-rw-r--r-- | views/calendar/qml/View.qml | 130 |
1 files changed, 92 insertions, 38 deletions
diff --git a/views/calendar/qml/View.qml b/views/calendar/qml/View.qml index e7df6dd2..ac82ec70 100644 --- a/views/calendar/qml/View.qml +++ b/views/calendar/qml/View.qml | |||
@@ -18,7 +18,7 @@ | |||
18 | 18 | ||
19 | import QtQuick 2.4 | 19 | import QtQuick 2.4 |
20 | import QtQuick.Layouts 1.1 | 20 | import QtQuick.Layouts 1.1 |
21 | import QtQuick.Controls 2.0 | 21 | import QtQuick.Controls 2.3 |
22 | import Qt.labs.calendar 1.0 | 22 | import Qt.labs.calendar 1.0 |
23 | 23 | ||
24 | import org.kube.framework 1.0 as Kube | 24 | import org.kube.framework 1.0 as Kube |
@@ -26,14 +26,20 @@ import org.kube.framework 1.0 as Kube | |||
26 | FocusScope { | 26 | FocusScope { |
27 | id: root | 27 | id: root |
28 | 28 | ||
29 | property var month: Calendar.March | ||
30 | property var year: 2017 | ||
31 | 29 | ||
32 | Column { | 30 | Item { |
33 | anchors.centerIn: parent | 31 | anchors { |
32 | top: parent.top | ||
33 | topMargin: Kube.Units.largeSpacing | ||
34 | horizontalCenter: parent.horizontalCenter | ||
35 | } | ||
36 | |||
37 | width: Kube.Units.gridUnit * 7 * 7 + Kube.Units.gridUnit * 2 | ||
38 | height: Kube.Units.gridUnit * 27 | ||
34 | 39 | ||
35 | DayOfWeekRow { | 40 | DayOfWeekRow { |
36 | anchors.horizontalCenter: parent.horizontalCenter | 41 | id: dayLabels |
42 | anchors.right: parent.right | ||
37 | spacing: 0 | 43 | spacing: 0 |
38 | locale: Qt.locale("de") | 44 | locale: Qt.locale("de") |
39 | 45 | ||
@@ -56,15 +62,22 @@ FocusScope { | |||
56 | } | 62 | } |
57 | } | 63 | } |
58 | 64 | ||
65 | |||
59 | Rectangle { | 66 | Rectangle { |
67 | id: daylong | ||
68 | |||
69 | anchors { | ||
70 | top: dayLabels.bottom | ||
71 | right: parent.right | ||
72 | } | ||
73 | |||
60 | height: Kube.Units.gridUnit * 3 | 74 | height: Kube.Units.gridUnit * 3 |
61 | width: parent.width | 75 | width: Kube.Units.gridUnit * 7 * 7 |
62 | color: Kube.Colors.viewBackgroundColor | 76 | color: Kube.Colors.viewBackgroundColor |
63 | border.width: 1 | 77 | border.width: 1 |
64 | border.color: Kube.Colors.buttonColor | 78 | border.color: Kube.Colors.buttonColor |
65 | 79 | ||
66 | ListView { | 80 | ListView { |
67 | id: daylong | ||
68 | 81 | ||
69 | anchors { | 82 | anchors { |
70 | fill: parent | 83 | fill: parent |
@@ -98,53 +111,94 @@ FocusScope { | |||
98 | } | 111 | } |
99 | } | 112 | } |
100 | 113 | ||
101 | RowLayout { | 114 | Flickable { |
102 | anchors.horizontalCenter: parent.horizontalCenter | 115 | id: mainWeekViewer |
103 | 116 | ||
104 | spacing: 0 | 117 | anchors { |
118 | top: daylong.bottom | ||
119 | } | ||
120 | |||
121 | height: Kube.Units.gridUnit * 24 | ||
122 | width: Kube.Units.gridUnit * 7 * 7 + Kube.Units.gridUnit * 2 | ||
123 | |||
124 | contentHeight: Kube.Units.gridUnit * 24 * 2 | ||
125 | contentWidth: width | ||
105 | 126 | ||
106 | Repeater { | 127 | clip: true |
107 | model: WeekEvents{} | 128 | boundsBehavior: Flickable.StopAtBounds |
108 | delegate: Rectangle { | ||
109 | id: day | ||
110 | 129 | ||
111 | property var events: model.events | 130 | ScrollBar.vertical: Kube.ScrollBar {} |
112 | 131 | ||
113 | width: Kube.Units.gridUnit * 7 | 132 | Row { |
114 | height: Kube.Units.gridUnit * 20 | ||
115 | 133 | ||
116 | border.width: 1 | 134 | height: Kube.Units.gridUnit * 24 * 2 |
117 | border.color: "lightgrey" | 135 | width: Kube.Units.gridUnit * 7 * 7 + Kube.Units.gridUnit * 2 |
118 | color: Kube.Colors.viewBackgroundColor | ||
119 | 136 | ||
137 | spacing: 0 | ||
138 | |||
139 | Column { | ||
140 | anchors.bottom: parent.bottom | ||
120 | Repeater { | 141 | Repeater { |
121 | model: parent.events | 142 | model: ["0:00","1:00","2:00","3:00","4:00","5:00","6:00","7:00","8:00","9:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00"] |
143 | delegate: Item { | ||
144 | height: Kube.Units.gridUnit * 2 | ||
145 | width: Kube.Units.gridUnit * 2 | ||
122 | 146 | ||
123 | delegate: Rectangle { | 147 | Kube.Label { |
124 | anchors { | 148 | anchors { |
125 | right: parent.right | 149 | right: parent.right |
126 | rightMargin: Kube.Units.smallSpacing | 150 | rightMargin: Kube.Units.smallSpacing |
151 | } | ||
152 | text: model.modelData | ||
127 | } | 153 | } |
128 | width: parent.width - Kube.Units.smallSpacing * 2 - Kube.Units.gridUnit * model.indention | 154 | } |
129 | height: Kube.Units.gridUnit * model.duration | 155 | } |
130 | y: Kube.Units.gridUnit * model.starts | 156 | } |
131 | x: Kube.Units.gridUnit * model.indention | ||
132 | 157 | ||
133 | color: model.color | 158 | Repeater { |
134 | border.width: 1 | 159 | model: WeekEvents{} |
135 | border.color: Kube.Colors.viewBackgroundColor | 160 | delegate: Rectangle { |
161 | id: day | ||
136 | 162 | ||
137 | Kube.Label { | 163 | property var events: model.events |
164 | |||
165 | width: Kube.Units.gridUnit * 7 | ||
166 | height: Kube.Units.gridUnit * 24 * 2 | ||
167 | |||
168 | border.width: 1 | ||
169 | border.color: "lightgrey" | ||
170 | color: Kube.Colors.viewBackgroundColor | ||
171 | |||
172 | Repeater { | ||
173 | model: parent.events | ||
174 | |||
175 | delegate: Rectangle { | ||
138 | anchors { | 176 | anchors { |
139 | left: parent.left | 177 | right: parent.right |
140 | leftMargin: Kube.Units.smallSpacing | 178 | rightMargin: Kube.Units.smallSpacing |
179 | } | ||
180 | width: parent.width - Kube.Units.smallSpacing * 2 - Kube.Units.gridUnit * model.indention | ||
181 | height: Kube.Units.gridUnit * model.duration | ||
182 | y: Kube.Units.gridUnit * model.starts | ||
183 | x: Kube.Units.gridUnit * model.indention | ||
184 | |||
185 | color: model.color | ||
186 | border.width: 1 | ||
187 | border.color: Kube.Colors.viewBackgroundColor | ||
188 | |||
189 | Kube.Label { | ||
190 | anchors { | ||
191 | left: parent.left | ||
192 | leftMargin: Kube.Units.smallSpacing | ||
193 | } | ||
194 | text: model.text | ||
195 | color: Kube.Colors.highlightedTextColor | ||
141 | } | 196 | } |
142 | text: model.text | ||
143 | color: Kube.Colors.highlightedTextColor | ||
144 | } | 197 | } |
145 | } | 198 | } |
146 | } | 199 | } |
147 | } | 200 | } |
201 | |||
148 | } | 202 | } |
149 | } | 203 | } |
150 | } | 204 | } |