diff options
author | Michael Bohlender <michael.bohlender@kdemail.net> | 2018-03-15 08:55:54 +0100 |
---|---|---|
committer | Michael Bohlender <michael.bohlender@kdemail.net> | 2018-03-15 08:56:18 +0100 |
commit | fb8c18b8f86bca090a52fee08cd25116fe66ebb5 (patch) | |
tree | a8519b356d9ecbbca892ccdd5acb5e60a54fb6aa | |
parent | a728bb2e3c970183a86fa92fe5d24cdfe95e7812 (diff) | |
download | kube-fb8c18b8f86bca090a52fee08cd25116fe66ebb5.tar.gz kube-fb8c18b8f86bca090a52fee08cd25116fe66ebb5.zip |
initial month view
-rw-r--r-- | views/calendar/qml/MonthView.qml | 98 | ||||
-rw-r--r-- | views/calendar/qml/View.qml | 255 | ||||
-rw-r--r-- | views/calendar/qml/WeekView.qml | 273 |
3 files changed, 374 insertions, 252 deletions
diff --git a/views/calendar/qml/MonthView.qml b/views/calendar/qml/MonthView.qml new file mode 100644 index 00000000..a4505eef --- /dev/null +++ b/views/calendar/qml/MonthView.qml | |||
@@ -0,0 +1,98 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2018 Michael Bohlender, <bohlender@kolabsys.com> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | import QtQuick 2.4 | ||
20 | import QtQuick.Layouts 1.1 | ||
21 | import QtQuick.Controls 2.3 | ||
22 | import Qt.labs.calendar 1.0 | ||
23 | |||
24 | import org.kube.framework 1.0 as Kube | ||
25 | |||
26 | FocusScope { | ||
27 | id: root | ||
28 | |||
29 | DayOfWeekRow { | ||
30 | anchors { | ||
31 | left: monthGrid.left | ||
32 | bottom: monthGrid.top | ||
33 | } | ||
34 | width: monthGrid.width | ||
35 | |||
36 | delegate: Kube.Label { | ||
37 | text: model.shortName | ||
38 | } | ||
39 | } | ||
40 | |||
41 | MonthGrid { | ||
42 | id: monthGrid | ||
43 | |||
44 | anchors.centerIn: parent | ||
45 | |||
46 | spacing: 0 | ||
47 | |||
48 | delegate: Rectangle { | ||
49 | width: Kube.Units.gridUnit * 7 | ||
50 | height: Kube.Units.gridUnit * 5 | ||
51 | |||
52 | color: Kube.Colors.viewBackgroundColor | ||
53 | border.color: Kube.Colors.buttonColor | ||
54 | border.width: 1 | ||
55 | |||
56 | Item { | ||
57 | id: dayInfo | ||
58 | |||
59 | height: Kube.Units.gridUnit | ||
60 | width: parent.width | ||
61 | |||
62 | Kube.Label { | ||
63 | anchors { | ||
64 | top: parent.top | ||
65 | left: parent.left | ||
66 | topMargin: Kube.Units.smallSpacing | ||
67 | leftMargin: Kube.Units.smallSpacing | ||
68 | } | ||
69 | text: model.day | ||
70 | } | ||
71 | } | ||
72 | |||
73 | ListView { | ||
74 | anchors { | ||
75 | top: dayInfo.bottom | ||
76 | left: parent.left | ||
77 | right: parent.right | ||
78 | bottom: parent.bottom | ||
79 | topMargin: Kube.Units.smallSpacing | ||
80 | leftMargin: 1 | ||
81 | rightMargin: 1 | ||
82 | } | ||
83 | clip: true | ||
84 | |||
85 | model: 2 | ||
86 | |||
87 | delegate: Rectangle { | ||
88 | |||
89 | width: parent.width - 2 | ||
90 | height: Kube.Units.gridUnit | ||
91 | color: "blue" | ||
92 | border.width: 1 | ||
93 | border.color: Kube.Colors.viewBackgroundColor | ||
94 | } | ||
95 | } | ||
96 | } | ||
97 | } | ||
98 | } | ||
diff --git a/views/calendar/qml/View.qml b/views/calendar/qml/View.qml index 8eef3a92..dfe86c13 100644 --- a/views/calendar/qml/View.qml +++ b/views/calendar/qml/View.qml | |||
@@ -17,257 +17,8 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | import QtQuick 2.4 | 19 | import QtQuick 2.4 |
20 | import QtQuick.Layouts 1.1 | ||
21 | import QtQuick.Controls 2.3 | ||
22 | import Qt.labs.calendar 1.0 | ||
23 | 20 | ||
24 | import org.kube.framework 1.0 as Kube | 21 | WeekView { |
25 | 22 | anchors.fill: parent | |
26 | FocusScope { | ||
27 | id: root | ||
28 | |||
29 | Item { | ||
30 | anchors { | ||
31 | top: parent.top | ||
32 | topMargin: Kube.Units.largeSpacing | ||
33 | horizontalCenter: parent.horizontalCenter | ||
34 | } | ||
35 | |||
36 | width: Kube.Units.gridUnit * 7 * 7 + Kube.Units.gridUnit * 2 | ||
37 | height: Kube.Units.gridUnit * 27 | ||
38 | |||
39 | //BEGIN day labels | ||
40 | DayOfWeekRow { | ||
41 | id: dayLabels | ||
42 | anchors.right: parent.right | ||
43 | spacing: 0 | ||
44 | locale: Qt.locale("en_GB") | ||
45 | |||
46 | delegate: Rectangle { | ||
47 | width: Kube.Units.gridUnit * 7 | ||
48 | height: Kube.Units.gridUnit + Kube.Units.smallSpacing * 3 | ||
49 | |||
50 | border.width: 1 | ||
51 | border.color: "lightgrey" | ||
52 | color: Kube.Colors.viewBackgroundColor | ||
53 | |||
54 | Kube.Label { | ||
55 | anchors { | ||
56 | top: parent.top | ||
57 | left: parent.left | ||
58 | margins: Kube.Units.smallSpacing | ||
59 | } | ||
60 | text: model.shortName | ||
61 | } | ||
62 | } | ||
63 | } | ||
64 | //END day labels | ||
65 | |||
66 | //BEGIN daylong events | ||
67 | Rectangle { | ||
68 | id: daylong | ||
69 | |||
70 | anchors { | ||
71 | top: dayLabels.bottom | ||
72 | right: parent.right | ||
73 | } | ||
74 | |||
75 | height: Kube.Units.gridUnit * 3 | ||
76 | width: Kube.Units.gridUnit * 7 * 7 | ||
77 | color: Kube.Colors.viewBackgroundColor | ||
78 | border.width: 1 | ||
79 | border.color: Kube.Colors.buttonColor | ||
80 | |||
81 | ListView { | ||
82 | |||
83 | anchors { | ||
84 | fill: parent | ||
85 | margins: 1 | ||
86 | } | ||
87 | |||
88 | model: DaylongEvents {} | ||
89 | |||
90 | delegate: Item { | ||
91 | height: Kube.Units.gridUnit + 2 // +2 to make good for the white border | ||
92 | width: daylong.width | ||
93 | |||
94 | Rectangle { | ||
95 | width: Kube.Units.gridUnit * 7 * model.duration | ||
96 | height: parent.height | ||
97 | x: Kube.Units.gridUnit * 7 * model.starts | ||
98 | color: model.color | ||
99 | border.width: 1 | ||
100 | border.color: Kube.Colors.viewBackgroundColor | ||
101 | |||
102 | Kube.Label { | ||
103 | anchors { | ||
104 | left: parent.left | ||
105 | leftMargin: Kube.Units.smallSpacing | ||
106 | } | ||
107 | color: Kube.Colors.highlightedTextColor | ||
108 | text: model.text | ||
109 | } | ||
110 | } | ||
111 | } | ||
112 | } | ||
113 | } | ||
114 | //END daylong events | ||
115 | |||
116 | Flickable { | ||
117 | id: mainWeekViewer | ||
118 | |||
119 | anchors { | ||
120 | top: daylong.bottom | ||
121 | } | ||
122 | |||
123 | height: Kube.Units.gridUnit * 24 | ||
124 | width: Kube.Units.gridUnit * 7 * 7 + Kube.Units.gridUnit * 2 | ||
125 | |||
126 | contentHeight: Kube.Units.gridUnit * 24 * 2 | ||
127 | contentWidth: width | ||
128 | |||
129 | clip: true | ||
130 | boundsBehavior: Flickable.StopAtBounds | ||
131 | |||
132 | ScrollBar.vertical: Kube.ScrollBar {} | ||
133 | |||
134 | Row { | ||
135 | |||
136 | height: Kube.Units.gridUnit * 24 * 2 | ||
137 | width: Kube.Units.gridUnit * 7 * 7 + Kube.Units.gridUnit * 2 | ||
138 | |||
139 | spacing: 0 | ||
140 | |||
141 | //BEGIN time labels | ||
142 | Column { | ||
143 | anchors.bottom: parent.bottom | ||
144 | Repeater { | ||
145 | model: ["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","0:00"] | ||
146 | delegate: Item { | ||
147 | height: Kube.Units.gridUnit * 2 | ||
148 | width: Kube.Units.gridUnit * 2 | ||
149 | |||
150 | Kube.Label { | ||
151 | anchors { | ||
152 | right: parent.right | ||
153 | rightMargin: Kube.Units.smallSpacing | ||
154 | bottom: parent.bottom | ||
155 | } | ||
156 | text: model.modelData | ||
157 | } | ||
158 | } | ||
159 | } | ||
160 | } | ||
161 | //END time labels | ||
162 | |||
163 | Repeater { | ||
164 | model: WeekEvents{} | ||
165 | delegate: Rectangle { | ||
166 | id: day | ||
167 | |||
168 | property var events: model.events | ||
169 | |||
170 | width: Kube.Units.gridUnit * 7 | ||
171 | height: Kube.Units.gridUnit * 24 * 2 | ||
172 | |||
173 | border.width: 1 | ||
174 | border.color: "lightgrey" | ||
175 | color: Kube.Colors.viewBackgroundColor | ||
176 | |||
177 | Column { | ||
178 | anchors.fill: parent | ||
179 | Repeater { | ||
180 | model: 24 | ||
181 | delegate: Rectangle { | ||
182 | height: Kube.Units.gridUnit * 4 | ||
183 | width: parent.width | ||
184 | color: "transparent" | ||
185 | border.width:1 | ||
186 | border.color: "lightgrey" | ||
187 | } | ||
188 | } | ||
189 | } | ||
190 | |||
191 | Repeater { | ||
192 | model: parent.events | ||
193 | |||
194 | delegate: Rectangle { | ||
195 | id: eventDelegate | ||
196 | |||
197 | states: [ | ||
198 | State { | ||
199 | name: "dnd" | ||
200 | when: mouseArea.drag.active | ||
201 | |||
202 | PropertyChanges {target: mouseArea; cursorShape: Qt.ClosedHandCursor} | ||
203 | PropertyChanges {target: eventDelegate; x: x; y: y} | ||
204 | PropertyChanges {target: eventDelegate; parent: root} | ||
205 | PropertyChanges {target: eventDelegate; opacity: 0.7} | ||
206 | PropertyChanges {target: eventDelegate; anchors.right: ""} | ||
207 | PropertyChanges {target: eventDelegate; width: Kube.Units.gridUnit * 7 - Kube.Units.smallSpacing * 2} | ||
208 | } | ||
209 | ] | ||
210 | |||
211 | anchors { | ||
212 | right: parent.right | ||
213 | rightMargin: Kube.Units.smallSpacing | ||
214 | } | ||
215 | width: Kube.Units.gridUnit * 7 - Kube.Units.smallSpacing * 2 - Kube.Units.gridUnit * model.indention | ||
216 | height: Kube.Units.gridUnit * model.duration | ||
217 | y: Kube.Units.gridUnit * model.starts | ||
218 | x: Kube.Units.gridUnit * model.indention | ||
219 | |||
220 | color: model.color | ||
221 | border.width: 1 | ||
222 | border.color: Kube.Colors.viewBackgroundColor | ||
223 | |||
224 | Kube.Label { | ||
225 | anchors { | ||
226 | left: parent.left | ||
227 | leftMargin: Kube.Units.smallSpacing | ||
228 | } | ||
229 | text: model.text | ||
230 | color: Kube.Colors.highlightedTextColor | ||
231 | } | ||
232 | |||
233 | Drag.active: mouseArea.drag.active | ||
234 | Drag.hotSpot.x: mouseArea.mouseX | ||
235 | Drag.hotSpot.y: mouseArea.mouseY | ||
236 | Drag.source: eventDelegate | ||
237 | |||
238 | MouseArea { | ||
239 | id: mouseArea | ||
240 | anchors.fill: parent | ||
241 | |||
242 | hoverEnabled: true | ||
243 | drag.target: parent | ||
244 | |||
245 | onEntered: { | ||
246 | eventDelegate.z = eventDelegate.z + 100 | ||
247 | } | ||
248 | onExited: { | ||
249 | eventDelegate.z = eventDelegate.z - 100 | ||
250 | |||
251 | } | ||
252 | |||
253 | onReleased: eventDelegate.Drag.drop() | ||
254 | } | ||
255 | } | ||
256 | } | ||
257 | |||
258 | DropArea { | ||
259 | anchors.fill: parent | ||
260 | |||
261 | onDropped: { | ||
262 | console.log("DROP") | ||
263 | drop.accept(Qt.MoveAction) | ||
264 | drop.source.visible = false | ||
265 | console.log((drop.source.y - mainWeekViewer.y + mainWeekViewer.contentY) / Kube.Units.gridUnit) | ||
266 | } | ||
267 | } | ||
268 | } | ||
269 | } | ||
270 | } | ||
271 | } | ||
272 | } | ||
273 | } | 23 | } |
24 | |||
diff --git a/views/calendar/qml/WeekView.qml b/views/calendar/qml/WeekView.qml new file mode 100644 index 00000000..8eef3a92 --- /dev/null +++ b/views/calendar/qml/WeekView.qml | |||
@@ -0,0 +1,273 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2018 Michael Bohlender, <bohlender@kolabsys.com> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | import QtQuick 2.4 | ||
20 | import QtQuick.Layouts 1.1 | ||
21 | import QtQuick.Controls 2.3 | ||
22 | import Qt.labs.calendar 1.0 | ||
23 | |||
24 | import org.kube.framework 1.0 as Kube | ||
25 | |||
26 | FocusScope { | ||
27 | id: root | ||
28 | |||
29 | Item { | ||
30 | anchors { | ||
31 | top: parent.top | ||
32 | topMargin: Kube.Units.largeSpacing | ||
33 | horizontalCenter: parent.horizontalCenter | ||
34 | } | ||
35 | |||
36 | width: Kube.Units.gridUnit * 7 * 7 + Kube.Units.gridUnit * 2 | ||
37 | height: Kube.Units.gridUnit * 27 | ||
38 | |||
39 | //BEGIN day labels | ||
40 | DayOfWeekRow { | ||
41 | id: dayLabels | ||
42 | anchors.right: parent.right | ||
43 | spacing: 0 | ||
44 | locale: Qt.locale("en_GB") | ||
45 | |||
46 | delegate: Rectangle { | ||
47 | width: Kube.Units.gridUnit * 7 | ||
48 | height: Kube.Units.gridUnit + Kube.Units.smallSpacing * 3 | ||
49 | |||
50 | border.width: 1 | ||
51 | border.color: "lightgrey" | ||
52 | color: Kube.Colors.viewBackgroundColor | ||
53 | |||
54 | Kube.Label { | ||
55 | anchors { | ||
56 | top: parent.top | ||
57 | left: parent.left | ||
58 | margins: Kube.Units.smallSpacing | ||
59 | } | ||
60 | text: model.shortName | ||
61 | } | ||
62 | } | ||
63 | } | ||
64 | //END day labels | ||
65 | |||
66 | //BEGIN daylong events | ||
67 | Rectangle { | ||
68 | id: daylong | ||
69 | |||
70 | anchors { | ||
71 | top: dayLabels.bottom | ||
72 | right: parent.right | ||
73 | } | ||
74 | |||
75 | height: Kube.Units.gridUnit * 3 | ||
76 | width: Kube.Units.gridUnit * 7 * 7 | ||
77 | color: Kube.Colors.viewBackgroundColor | ||
78 | border.width: 1 | ||
79 | border.color: Kube.Colors.buttonColor | ||
80 | |||
81 | ListView { | ||
82 | |||
83 | anchors { | ||
84 | fill: parent | ||
85 | margins: 1 | ||
86 | } | ||
87 | |||
88 | model: DaylongEvents {} | ||
89 | |||
90 | delegate: Item { | ||
91 | height: Kube.Units.gridUnit + 2 // +2 to make good for the white border | ||
92 | width: daylong.width | ||
93 | |||
94 | Rectangle { | ||
95 | width: Kube.Units.gridUnit * 7 * model.duration | ||
96 | height: parent.height | ||
97 | x: Kube.Units.gridUnit * 7 * model.starts | ||
98 | color: model.color | ||
99 | border.width: 1 | ||
100 | border.color: Kube.Colors.viewBackgroundColor | ||
101 | |||
102 | Kube.Label { | ||
103 | anchors { | ||
104 | left: parent.left | ||
105 | leftMargin: Kube.Units.smallSpacing | ||
106 | } | ||
107 | color: Kube.Colors.highlightedTextColor | ||
108 | text: model.text | ||
109 | } | ||
110 | } | ||
111 | } | ||
112 | } | ||
113 | } | ||
114 | //END daylong events | ||
115 | |||
116 | Flickable { | ||
117 | id: mainWeekViewer | ||
118 | |||
119 | anchors { | ||
120 | top: daylong.bottom | ||
121 | } | ||
122 | |||
123 | height: Kube.Units.gridUnit * 24 | ||
124 | width: Kube.Units.gridUnit * 7 * 7 + Kube.Units.gridUnit * 2 | ||
125 | |||
126 | contentHeight: Kube.Units.gridUnit * 24 * 2 | ||
127 | contentWidth: width | ||
128 | |||
129 | clip: true | ||
130 | boundsBehavior: Flickable.StopAtBounds | ||
131 | |||
132 | ScrollBar.vertical: Kube.ScrollBar {} | ||
133 | |||
134 | Row { | ||
135 | |||
136 | height: Kube.Units.gridUnit * 24 * 2 | ||
137 | width: Kube.Units.gridUnit * 7 * 7 + Kube.Units.gridUnit * 2 | ||
138 | |||
139 | spacing: 0 | ||
140 | |||
141 | //BEGIN time labels | ||
142 | Column { | ||
143 | anchors.bottom: parent.bottom | ||
144 | Repeater { | ||
145 | model: ["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","0:00"] | ||
146 | delegate: Item { | ||
147 | height: Kube.Units.gridUnit * 2 | ||
148 | width: Kube.Units.gridUnit * 2 | ||
149 | |||
150 | Kube.Label { | ||
151 | anchors { | ||
152 | right: parent.right | ||
153 | rightMargin: Kube.Units.smallSpacing | ||
154 | bottom: parent.bottom | ||
155 | } | ||
156 | text: model.modelData | ||
157 | } | ||
158 | } | ||
159 | } | ||
160 | } | ||
161 | //END time labels | ||
162 | |||
163 | Repeater { | ||
164 | model: WeekEvents{} | ||
165 | delegate: Rectangle { | ||
166 | id: day | ||
167 | |||
168 | property var events: model.events | ||
169 | |||
170 | width: Kube.Units.gridUnit * 7 | ||
171 | height: Kube.Units.gridUnit * 24 * 2 | ||
172 | |||
173 | border.width: 1 | ||
174 | border.color: "lightgrey" | ||
175 | color: Kube.Colors.viewBackgroundColor | ||
176 | |||
177 | Column { | ||
178 | anchors.fill: parent | ||
179 | Repeater { | ||
180 | model: 24 | ||
181 | delegate: Rectangle { | ||
182 | height: Kube.Units.gridUnit * 4 | ||
183 | width: parent.width | ||
184 | color: "transparent" | ||
185 | border.width:1 | ||
186 | border.color: "lightgrey" | ||
187 | } | ||
188 | } | ||
189 | } | ||
190 | |||
191 | Repeater { | ||
192 | model: parent.events | ||
193 | |||
194 | delegate: Rectangle { | ||
195 | id: eventDelegate | ||
196 | |||
197 | states: [ | ||
198 | State { | ||
199 | name: "dnd" | ||
200 | when: mouseArea.drag.active | ||
201 | |||
202 | PropertyChanges {target: mouseArea; cursorShape: Qt.ClosedHandCursor} | ||
203 | PropertyChanges {target: eventDelegate; x: x; y: y} | ||
204 | PropertyChanges {target: eventDelegate; parent: root} | ||
205 | PropertyChanges {target: eventDelegate; opacity: 0.7} | ||
206 | PropertyChanges {target: eventDelegate; anchors.right: ""} | ||
207 | PropertyChanges {target: eventDelegate; width: Kube.Units.gridUnit * 7 - Kube.Units.smallSpacing * 2} | ||
208 | } | ||
209 | ] | ||
210 | |||
211 | anchors { | ||
212 | right: parent.right | ||
213 | rightMargin: Kube.Units.smallSpacing | ||
214 | } | ||
215 | width: Kube.Units.gridUnit * 7 - Kube.Units.smallSpacing * 2 - Kube.Units.gridUnit * model.indention | ||
216 | height: Kube.Units.gridUnit * model.duration | ||
217 | y: Kube.Units.gridUnit * model.starts | ||
218 | x: Kube.Units.gridUnit * model.indention | ||
219 | |||
220 | color: model.color | ||
221 | border.width: 1 | ||
222 | border.color: Kube.Colors.viewBackgroundColor | ||
223 | |||
224 | Kube.Label { | ||
225 | anchors { | ||
226 | left: parent.left | ||
227 | leftMargin: Kube.Units.smallSpacing | ||
228 | } | ||
229 | text: model.text | ||
230 | color: Kube.Colors.highlightedTextColor | ||
231 | } | ||
232 | |||
233 | Drag.active: mouseArea.drag.active | ||
234 | Drag.hotSpot.x: mouseArea.mouseX | ||
235 | Drag.hotSpot.y: mouseArea.mouseY | ||
236 | Drag.source: eventDelegate | ||
237 | |||
238 | MouseArea { | ||
239 | id: mouseArea | ||
240 | anchors.fill: parent | ||
241 | |||
242 | hoverEnabled: true | ||
243 | drag.target: parent | ||
244 | |||
245 | onEntered: { | ||
246 | eventDelegate.z = eventDelegate.z + 100 | ||
247 | } | ||
248 | onExited: { | ||
249 | eventDelegate.z = eventDelegate.z - 100 | ||
250 | |||
251 | } | ||
252 | |||
253 | onReleased: eventDelegate.Drag.drop() | ||
254 | } | ||
255 | } | ||
256 | } | ||
257 | |||
258 | DropArea { | ||
259 | anchors.fill: parent | ||
260 | |||
261 | onDropped: { | ||
262 | console.log("DROP") | ||
263 | drop.accept(Qt.MoveAction) | ||
264 | drop.source.visible = false | ||
265 | console.log((drop.source.y - mainWeekViewer.y + mainWeekViewer.contentY) / Kube.Units.gridUnit) | ||
266 | } | ||
267 | } | ||
268 | } | ||
269 | } | ||
270 | } | ||
271 | } | ||
272 | } | ||
273 | } | ||