summaryrefslogtreecommitdiffstats
path: root/views/calendar/qml/WeekView.qml
diff options
context:
space:
mode:
Diffstat (limited to 'views/calendar/qml/WeekView.qml')
-rw-r--r--views/calendar/qml/WeekView.qml24
1 files changed, 12 insertions, 12 deletions
diff --git a/views/calendar/qml/WeekView.qml b/views/calendar/qml/WeekView.qml
index 2f7aaccb..b590906c 100644
--- a/views/calendar/qml/WeekView.qml
+++ b/views/calendar/qml/WeekView.qml
@@ -26,19 +26,18 @@ import org.kube.framework 1.0 as Kube
26FocusScope { 26FocusScope {
27 id: root 27 id: root
28 28
29 property var dayWidth: Kube.Units.gridUnit * 7 29 property var dayWidth: (root.width - Kube.Units.gridUnit - Kube.Units.largeSpacing * 2) / 7
30 property var hourHeight: Kube.Units.gridUnit * 2 30 property var hourHeight: Kube.Units.gridUnit * 2
31 31
32 32
33 Item { 33 Item {
34 anchors { 34 anchors {
35 top: parent.top 35 top: parent.top
36 topMargin: Kube.Units.largeSpacing
37 right: parent.right 36 right: parent.right
38 } 37 }
39 38
40 width: root.dayWidth * 7 + Kube.Units.gridUnit * 2 39 width: root.dayWidth * 7 + Kube.Units.gridUnit * 2
41 height: Kube.Units.gridUnit * 27 40 height: root.height
42 41
43 //BEGIN day labels 42 //BEGIN day labels
44 DayOfWeekRow { 43 DayOfWeekRow {
@@ -48,7 +47,7 @@ FocusScope {
48 locale: Qt.locale("en_GB") 47 locale: Qt.locale("en_GB")
49 48
50 delegate: Rectangle { 49 delegate: Rectangle {
51 width: Kube.Units.gridUnit * 7 50 width: root.dayWidth
52 height: Kube.Units.gridUnit + Kube.Units.smallSpacing * 3 51 height: Kube.Units.gridUnit + Kube.Units.smallSpacing * 3
53 52
54 border.width: 1 53 border.width: 1
@@ -77,7 +76,7 @@ FocusScope {
77 } 76 }
78 77
79 height: Kube.Units.gridUnit * 3 78 height: Kube.Units.gridUnit * 3
80 width: Kube.Units.gridUnit * 7 * 7 79 width: root.dayWidth * 7
81 color: Kube.Colors.viewBackgroundColor 80 color: Kube.Colors.viewBackgroundColor
82 border.width: 1 81 border.width: 1
83 border.color: Kube.Colors.buttonColor 82 border.color: Kube.Colors.buttonColor
@@ -96,9 +95,9 @@ FocusScope {
96 width: daylong.width 95 width: daylong.width
97 96
98 Rectangle { 97 Rectangle {
99 width: Kube.Units.gridUnit * 7 * model.duration 98 width: root.dayWidth * model.duration
100 height: parent.height 99 height: parent.height
101 x: Kube.Units.gridUnit * 7 * model.starts 100 x: root.dayWidth * model.starts
102 color: model.color 101 color: model.color
103 border.width: 1 102 border.width: 1
104 border.color: Kube.Colors.viewBackgroundColor 103 border.color: Kube.Colors.viewBackgroundColor
@@ -124,7 +123,8 @@ FocusScope {
124 top: daylong.bottom 123 top: daylong.bottom
125 } 124 }
126 125
127 height: Kube.Units.gridUnit * 24 126 Layout.fillWidth: true
127 height: root.height - daylong.height - dayLabels.height - Kube.Units.largeSpacing
128 width: root.dayWidth * 7 + Kube.Units.gridUnit * 2 128 width: root.dayWidth * 7 + Kube.Units.gridUnit * 2
129 129
130 contentHeight: root.hourHeight * 24 130 contentHeight: root.hourHeight * 24
@@ -145,7 +145,8 @@ FocusScope {
145 Column { 145 Column {
146 anchors.bottom: parent.bottom 146 anchors.bottom: parent.bottom
147 Repeater { 147 Repeater {
148 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"] 148 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",
149 "13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00","0:00"]
149 delegate: Item { 150 delegate: Item {
150 height: root.hourHeight 151 height: root.hourHeight
151 width: Kube.Units.gridUnit * 2 152 width: Kube.Units.gridUnit * 2
@@ -252,7 +253,6 @@ FocusScope {
252 eventDelegate.z = eventDelegate.z - 100 253 eventDelegate.z = eventDelegate.z - 100
253 254
254 } 255 }
255
256 onReleased: eventDelegate.Drag.drop() 256 onReleased: eventDelegate.Drag.drop()
257 } 257 }
258 } 258 }
@@ -264,8 +264,8 @@ FocusScope {
264 onDropped: { 264 onDropped: {
265 console.log("DROP") 265 console.log("DROP")
266 drop.accept(Qt.MoveAction) 266 drop.accept(Qt.MoveAction)
267 drop.source.visible = false 267 //drop.source.visible = false
268 console.log((drop.source.y - mainWeekViewer.y + mainWeekViewer.contentY) / Kube.Units.gridUnit) 268 console.log((drop.source.y - mainWeekViewer.y + mainWeekViewer.contentY) / hourHeight)
269 } 269 }
270 } 270 }
271 } 271 }