summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--views/calendar/qml/WeekView.qml33
1 files changed, 18 insertions, 15 deletions
diff --git a/views/calendar/qml/WeekView.qml b/views/calendar/qml/WeekView.qml
index 9eafe881..2f7aaccb 100644
--- a/views/calendar/qml/WeekView.qml
+++ b/views/calendar/qml/WeekView.qml
@@ -26,14 +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
30 property var hourHeight: Kube.Units.gridUnit * 2
31
32
29 Item { 33 Item {
30 anchors { 34 anchors {
31 top: parent.top 35 top: parent.top
32 topMargin: Kube.Units.largeSpacing 36 topMargin: Kube.Units.largeSpacing
33 horizontalCenter: parent.horizontalCenter 37 right: parent.right
34 } 38 }
35 39
36 width: Kube.Units.gridUnit * 7 * 7 + Kube.Units.gridUnit * 2 40 width: root.dayWidth * 7 + Kube.Units.gridUnit * 2
37 height: Kube.Units.gridUnit * 27 41 height: Kube.Units.gridUnit * 27
38 42
39 //BEGIN day labels 43 //BEGIN day labels
@@ -121,9 +125,9 @@ FocusScope {
121 } 125 }
122 126
123 height: Kube.Units.gridUnit * 24 127 height: Kube.Units.gridUnit * 24
124 width: Kube.Units.gridUnit * 7 * 7 + Kube.Units.gridUnit * 2 128 width: root.dayWidth * 7 + Kube.Units.gridUnit * 2
125 129
126 contentHeight: Kube.Units.gridUnit * 24 * 2 130 contentHeight: root.hourHeight * 24
127 contentWidth: width 131 contentWidth: width
128 132
129 clip: true 133 clip: true
@@ -132,9 +136,8 @@ FocusScope {
132 ScrollBar.vertical: Kube.ScrollBar {} 136 ScrollBar.vertical: Kube.ScrollBar {}
133 137
134 Row { 138 Row {
135 139 height: root.hourHeight * 24
136 height: Kube.Units.gridUnit * 24 * 2 140 width: root.dayWidth * 7 + Kube.Units.gridUnit * 2
137 width: Kube.Units.gridUnit * 7 * 7 + Kube.Units.gridUnit * 2
138 141
139 spacing: 0 142 spacing: 0
140 143
@@ -144,7 +147,7 @@ FocusScope {
144 Repeater { 147 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"] 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"]
146 delegate: Item { 149 delegate: Item {
147 height: Kube.Units.gridUnit * 2 150 height: root.hourHeight
148 width: Kube.Units.gridUnit * 2 151 width: Kube.Units.gridUnit * 2
149 152
150 Kube.Label { 153 Kube.Label {
@@ -167,8 +170,8 @@ FocusScope {
167 170
168 property var events: model.events 171 property var events: model.events
169 172
170 width: Kube.Units.gridUnit * 7 173 width: root.dayWidth
171 height: Kube.Units.gridUnit * 24 * 2 174 height: root.hourHeight * 24
172 175
173 border.width: 1 176 border.width: 1
174 border.color: "lightgrey" 177 border.color: "lightgrey"
@@ -179,7 +182,7 @@ FocusScope {
179 Repeater { 182 Repeater {
180 model: 24 183 model: 24
181 delegate: Rectangle { 184 delegate: Rectangle {
182 height: Kube.Units.gridUnit * 4 185 height: root.hourHeight * 2
183 width: parent.width 186 width: parent.width
184 color: "transparent" 187 color: "transparent"
185 border.width:1 188 border.width:1
@@ -204,7 +207,7 @@ FocusScope {
204 PropertyChanges {target: eventDelegate; parent: root} 207 PropertyChanges {target: eventDelegate; parent: root}
205 PropertyChanges {target: eventDelegate; opacity: 0.7} 208 PropertyChanges {target: eventDelegate; opacity: 0.7}
206 PropertyChanges {target: eventDelegate; anchors.right: ""} 209 PropertyChanges {target: eventDelegate; anchors.right: ""}
207 PropertyChanges {target: eventDelegate; width: Kube.Units.gridUnit * 7 - Kube.Units.smallSpacing * 2} 210 PropertyChanges {target: eventDelegate; width: root.dayWidth - Kube.Units.smallSpacing * 2}
208 } 211 }
209 ] 212 ]
210 213
@@ -212,9 +215,9 @@ FocusScope {
212 right: parent.right 215 right: parent.right
213 rightMargin: Kube.Units.smallSpacing 216 rightMargin: Kube.Units.smallSpacing
214 } 217 }
215 width: Kube.Units.gridUnit * 7 - Kube.Units.smallSpacing * 2 - Kube.Units.gridUnit * model.modelData.indention 218 width: root.dayWidth - Kube.Units.smallSpacing * 2 - Kube.Units.gridUnit * model.modelData.indention
216 height: Kube.Units.gridUnit * model.modelData.duration * 2 219 height: root.hourHeight * model.modelData.duration
217 y: Kube.Units.gridUnit * model.modelData.starts * 2 220 y: root.hourHeight * model.modelData.starts
218 x: Kube.Units.gridUnit * model.modelData.indention 221 x: Kube.Units.gridUnit * model.modelData.indention
219 222
220 color: model.modelData.color 223 color: model.modelData.color