~mihirsoni/ubuntu-calendar-app/dateSelectNewEventTest

« back to all changes in this revision

Viewing changes to TimeLineHeader.qml

  • Committer: Kunal Parmar
  • Date: 2014-10-03 04:15:55 UTC
  • mto: This revision was merged to the branch mainline in revision 498.
  • Revision ID: pkunal.parmar@gmail.com-20141003041555-fvk6rqflur745dlr
Dayview like iOS

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    width: parent.width
33
33
 
34
34
    property var date;
 
35
    property var currentDay;
35
36
 
36
37
    signal dateSelected(var date);
37
38
 
39
40
        type: header.type
40
41
 
41
42
        isCurrentItem: index == header.currentIndex
42
 
 
43
 
        width: {
44
 
            if( type == ViewType.ViewTypeWeek ) {
45
 
                parent.width
46
 
            } else if( type == ViewType.ViewTypeDay && isCurrentItem ){
47
 
                (header.width/7) * 5
48
 
            } else {
49
 
                (header.width/7)
50
 
            }
51
 
        }
52
 
 
53
 
        startDay: type == ViewType.ViewTypeWeek ? date.addDays(7*header.indexType(index))
54
 
                                                : date.addDays(1*header.indexType(index))
 
43
        currentDay: header.currentDay
 
44
 
 
45
        width: parent.width
 
46
 
 
47
        startDay: date.addDays(7*header.indexType(index))
55
48
 
56
49
        onDateSelected: {
57
50
            header.dateSelected(date);