~pkunal-parmar/ubuntu-calendar-app/NewDayView

« back to all changes in this revision

Viewing changes to TimeLineBackground.qml

  • Committer: Kunal Parmar
  • Date: 2014-11-15 08:02:45 UTC
  • Revision ID: pkunal.parmar@gmail.com-20141115080245-9f093ak1owlh5tl8
new day and week view

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import QtQuick 2.3
20
20
import Ubuntu.Components 1.1
 
21
import Ubuntu.Components.ListItems 1.0 as ListItem
21
22
 
22
23
Column {
23
24
    width: parent.width
24
 
 
25
 
    property real lableWidth: parent.width / 7
26
25
    Repeater {
27
26
        model: 24 // hour in a day
28
 
 
29
 
        delegate: Rectangle {
 
27
        delegate: Item {
30
28
            width: parent.width
31
 
            height: units.gu(10)
32
 
            color: (index % 2 == 0) ? "#F5F5F5" : "#ECECEC"
33
 
 
34
 
            Label {
35
 
                id: timeLabel
36
 
                width: lableWidth - units.gu(1)
37
 
                wrapMode: Text.WordWrap
38
 
 
39
 
                text: {
40
 
                    var locale = Qt.locale()                    
41
 
                    return new Date(0, 0, 0, index).toLocaleTimeString
42
 
                            (locale, locale.timeFormat(Locale.NarrowFormat))
43
 
                }
44
 
 
45
 
                anchors {
46
 
                    left: parent.left
47
 
                    leftMargin: units.gu(0.5)
48
 
                    verticalCenter: parent.verticalCenter
49
 
                }
50
 
 
51
 
                color: UbuntuColors.lightGrey
52
 
                fontSize: "small"
 
29
            height: units.gu(8)
 
30
            ListItem.Divider{
 
31
                height: units.gu(0.1)
53
32
            }
54
33
        }
55
34
    }
56
35
}
 
36