~nskaggs/ubuntu-calendar-app/autopilot-title-label

« back to all changes in this revision

Viewing changes to DiaryViewDelegate.qml

  • Committer: Tarmac
  • Author(s): Kunal Parmar
  • Date: 2013-06-10 13:18:36 UTC
  • mfrom: (33.2.13 ubuntu-calendar-app)
  • Revision ID: tarmac-20130610131836-wrhgfi0vqsldu1gv
Moved common code between DiaryView and TimeLineView to command EventViewBase QML.
Used state instead of property in EventViewBase.

Approved by Olivier Tilloy, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    function showEventData() {
22
22
        // FIXME: remove test value, need to decide what to do if there is no location, hide it ?
23
23
        var venues = [{"name":"Test Venue"}]
24
 
        DataService.getVenues(eventModel.get(index), venues)
 
24
        DataService.getVenues(diaryView.model.get(index), venues)
25
25
        if( venues.length > 0 ) {
26
26
            locationLabel.text = venues[0].name;
27
27
        }
28
28
 
29
29
        // FIXME: remove test value, need to decide what to do if there are no attendees, hide it ?
30
30
        var attendees = ["Test One","Test Two"]
31
 
        DataService.getAttendees(eventModel.get(index),attendees)
 
31
        DataService.getAttendees(diaryView.model.get(index),attendees)
32
32
        attendeeLabel.text = attendees.toString();
33
33
    }
34
34
 
36
36
        collapse(true);
37
37
 
38
38
        var now = new Date;
39
 
        var lastEvent = eventModel.get(index-1);
 
39
        var lastEvent = diaryView.model.get(index-1);
40
40
 
41
41
        if( endTime >= now
42
42
                && (lastEvent === undefined || lastEvent.endTime < now )
54
54
    height: eventRoot.height + seperator.height + (seperator.visible ? units.gu(1.5) : units.gu(0.5)) /*margins*/
55
55
    width: parent.width
56
56
 
57
 
    Rectangle {
 
57
    TimeSeparator {
58
58
        id: seperator
59
 
        height: units.gu(0.5)
60
59
        width: delegateRoot.width - units.gu(2)
61
60
        anchors.top: parent.top
62
61
        anchors.topMargin: units.gu(1)
63
62
        anchors.horizontalCenter: parent.horizontalCenter
64
 
        color: "#c94212"
65
63
        visible: false
66
64
    }
67
65