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

« back to all changes in this revision

Viewing changes to TimeLineHeaderComponent.qml

  • Committer: Tarmac
  • Author(s): Kunal Parmar
  • Date: 2013-10-16 14:36:51 UTC
  • mfrom: (124.4.1 ubuntu-calendar-app)
  • Revision ID: tarmac-20131016143651-06vm6y05lmgw53nk
Dark Background added to day labels.

Approved by David Planella, Ubuntu Phone Apps Jenkins Bot.

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