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

« back to all changes in this revision

Viewing changes to TimeLineHeaderComponent.qml

  • Committer: Kunal Parmar
  • Date: 2013-09-28 09:37:52 UTC
  • mto: This revision was merged to the branch mainline in revision 153.
  • Revision ID: pkunal.parmar@gmail.com-20130928093752-6hhmsea2xmtns5uk
Background added to day labels

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
import "dateExt.js" as DateExt
5
5
 
6
 
Column {
7
 
    id: root
 
6
 
 
7
Row{
 
8
    id: header
8
9
 
9
10
    readonly property int typeWeek: 0
10
11
    readonly property int typeDay: 1
15
16
 
16
17
    width: parent.width
17
18
 
18
 
    Row{
19
 
        id: header
20
 
 
21
 
        width: parent.width
22
 
        height: parent.height
23
 
 
24
 
        Repeater{
25
 
            model: type == typeWeek ? 7 : 1
26
 
 
27
 
            delegate: HeaderDateComponent{
28
 
                date: startDay.addDays(index);
29
 
                dayFormat: {
30
 
                    if( type == typeWeek || (type == typeDay && !root.isCurrentItem) ) {
31
 
                        Locale.ShortFormat
32
 
                    } else {
33
 
                        Locale.LongFormat
34
 
                    }
35
 
                }
36
 
 
37
 
                dateColor: {
38
 
                    if( type == typeWeek && date.isSameDay(DateExt.today())){
39
 
                        "white"
40
 
                    } else if( type == typeDay && root.isCurrentItem ) {
41
 
                        "white"
42
 
                    } else {
43
 
                        "#AEA79F"
44
 
                    }
45
 
                }
46
 
 
47
 
                width: {
48
 
                    if( type == typeWeek ) {
49
 
                         header.width/7
50
 
                    } else {
51
 
                        header.width
52
 
                    }
 
19
    Repeater{
 
20
        model: type == typeWeek ? 7 : 1
 
21
 
 
22
        delegate: HeaderDateComponent{
 
23
            date: startDay.addDays(index);
 
24
            dayFormat: {
 
25
                if( type == typeWeek || (type == typeDay && !root.isCurrentItem) ) {
 
26
                    Locale.ShortFormat
 
27
                } else {
 
28
                    Locale.LongFormat
 
29
                }
 
30
            }
 
31
 
 
32
            dateColor: {
 
33
                if( type == typeWeek && date.isSameDay(DateExt.today())){
 
34
                    "white"
 
35
                } else if( type == typeDay && root.isCurrentItem ) {
 
36
                    "white"
 
37
                } else {
 
38
                    "#AEA79F"
 
39
                }
 
40
            }
 
41
 
 
42
            width: {
 
43
                if( type == typeWeek ) {
 
44
                    header.width/7
 
45
                } else {
 
46
                    header.width
53
47
                }
54
48
            }
55
49
        }
56
50
    }
57
51
}
 
52