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

« back to all changes in this revision

Viewing changes to TimeLineHeaderComponent.qml

  • Committer: Tarmac
  • Author(s): Kunal Parmar
  • Date: 2015-01-08 17:13:47 UTC
  • mfrom: (550.3.7 ubuntu-calendar-app)
  • Revision ID: tarmac-20150108171347-k3tlx60ijghpkm3s
Required changed for new dayview and weekview .

Approved by Nekhelesh Ramananthan, Nicholas Skaggs, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    signal dateSelected(var date);
34
34
 
35
35
    width: parent.width
 
36
    height: units.gu(4)
36
37
 
37
38
    Repeater{
38
 
        model: 7
 
39
        model: type == ViewType.ViewTypeWeek ? 7 : 1
39
40
 
40
41
        delegate: HeaderDateComponent{
41
 
            date: startDay.addDays(index);
 
42
            date: type == ViewType.ViewTypeWeek ? startDay.addDays(index) : startDay
42
43
            dayFormat: Locale.ShortFormat
43
44
 
44
45
            dayColor: {
45
46
                if( type == ViewType.ViewTypeWeek && date.isSameDay(DateExt.today())){
46
47
                    UbuntuColors.orange
47
 
                } else if( type == ViewType.ViewTypeDay && date.isSameDay(currentDay) ) {
 
48
                } /*else if( type == ViewType.ViewTypeDay && date.isSameDay(currentDay) ) {
48
49
                    UbuntuColors.orange
49
 
                } else {
 
50
                } */ else {
50
51
                    UbuntuColors.darkGrey
51
52
                }
52
53
            }
53
54
 
54
 
            width: header.width/7
 
55
            width: type == ViewType.ViewTypeWeek ? ( header.width/7) : header.width
 
56
            height: header.height
55
57
 
56
58
            onDateSelected: {
57
59
                header.dateSelected(date);
58
60
            }
 
61
 
 
62
            Loader{
 
63
                objectName: "divider"
 
64
                height: parent.height
 
65
                width: units.gu(0.1)
 
66
                sourceComponent: type == ViewType.ViewTypeWeek ? dividerComponent : undefined
 
67
            }
 
68
 
 
69
            Component {
 
70
                id: dividerComponent
 
71
                SimpleDivider{
 
72
                    anchors.fill: parent
 
73
                }
 
74
            }
59
75
        }
60
76
    }
61
77
}