2
import QtQuick.Layouts 1.1
3
import Ubuntu.Components 1.3
8
property real columnWidth: units.gu(10)
9
property real headerWidth: units.gu(10)
10
property alias columns: columns.model
12
readonly property real hourHeight: (height / 24) - units.gu(0.5)
17
var today = new Date()
20
for(var h=0; h < 24; h++) {
22
//TODO: format to local time 24h or AM/PM
23
hoursInADay.push(Qt.formatTime(today))
26
hourRepeater.model = hoursInADay
30
implicitWidth: root.headerWidth + (root.columnWidth * root.columns)
31
implicitHeight: units.gu(7) * hourRepeater.count
35
spacing: units.gu(0.5)
42
width: root.headerWidth
43
height: root.hourHeight
44
horizontalAlignment: Text.AlignHCenter
61
leftMargin: root.headerWidth
69
top: parent ? parent.top : undefined
70
bottom: parent ? parent.bottom : undefined
72
width: root.columnWidth
87
Component.onCompleted: root.refresh()