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

« back to all changes in this revision

Viewing changes to EventView.qml

  • Committer: Frank Mertens
  • Date: 2013-03-26 00:37:48 UTC
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: frank@cyblogic.de-20130326003748-w3tx4rlussxhpu1v
Extended the database model by an events category and added a basic diary view.

The events category allows to use section headers.
The basic diary view uses the standard Ubuntu component ListItem.Standard to show
the events of the current day.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
    signal incrementCurrentDay
11
11
    signal decrementCurrentDay
12
12
 
 
13
    signal compressRequest()
 
14
    signal compressComplete()
 
15
    signal expandRequest()
 
16
    signal expandComplete()
 
17
 
 
18
    property bool expanded: false
 
19
 
13
20
    readonly property real visibleHeight: parent.height - y
14
21
 
15
22
    QtObject {
53
60
    model: 3
54
61
 
55
62
    delegate: DiaryView {
 
63
        id: diaryView
 
64
 
 
65
        width: eventView.width
 
66
        height: eventView.height
 
67
 
56
68
        dayStart: {
57
69
            if (index == intern.currentIndex) return intern.currentDayStart
58
70
            var previousIndex = intern.currentIndex > 0 ? intern.currentIndex - 1 : 2
59
71
            if (index == previousIndex) return intern.currentDayStart.addDays(-1)
60
72
            return intern.currentDayStart.addDays(1)
61
73
        }
62
 
        width: eventView.width
63
 
        height: eventView.height
 
74
 
 
75
        expanded: eventView.expanded
 
76
 
 
77
        onCompressRequest: eventView.compressRequest()
 
78
        onCompressComplete: eventView.compressComplete()
 
79
        onExpandRequest: eventView.expandRequest()
 
80
        onExpandComplete: eventView.expandComplete()
64
81
    }
65
82
}