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

« back to all changes in this revision

Viewing changes to MonthView.qml

  • Committer: Kunal Parmar
  • Date: 2014-10-22 17:28:07 UTC
  • Revision ID: pkunal.parmar@gmail.com-20141022172807-f8q4u2eb3obvutjv
performce improvements

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
            return  new Date(date.getFullYear(), date.getMonth() + month, 1, 0, 0, 0);
90
90
        }
91
91
 
92
 
        delegate: MonthComponent {
93
 
            property bool isCurrentItem: index === monthViewPath.currentIndex
94
 
 
95
 
            showEvents: true
96
 
 
 
92
        delegate: Loader {
97
93
            width: parent.width - units.gu(4)
98
94
            height: parent.height
99
95
 
100
 
            currentMonth: monthViewPath.addMonth(monthViewPath.startMonth,
101
 
                                                 monthViewPath.indexType(index));
102
 
 
103
 
            isYearView: false
104
 
 
105
 
            onDateSelected: {
106
 
                monthViewPage.dateSelected(date);
 
96
            sourceComponent: delegateComponent
 
97
            asynchronous: index !== monthViewPath.currentIndex
 
98
 
 
99
            Component {
 
100
                id: delegateComponent
 
101
 
 
102
                MonthComponent {
 
103
                    isCurrentItem: index === monthViewPath.currentIndex
 
104
 
 
105
                    showEvents: true
 
106
 
 
107
                    anchors.fill: parent
 
108
 
 
109
                    currentMonth: monthViewPath.addMonth(monthViewPath.startMonth,
 
110
                                                         monthViewPath.indexType(index));
 
111
 
 
112
                    isYearView: false
 
113
 
 
114
                    onDateSelected: {
 
115
                        monthViewPage.dateSelected(date);
 
116
                    }
 
117
                }
107
118
            }
108
119
        }
109
120
    }