~renatofilho/ubuntu-calendar-app/optimize

« back to all changes in this revision

Viewing changes to YearView.qml

  • Committer: Renato Araujo Oliveira Filho
  • Date: 2016-01-25 19:05:09 UTC
  • mfrom: (614.1.134 optimize-page-load)
  • Revision ID: renato.filho@canonical.com-20160125190509-yzdqc2a025iu2oqn
Parent merged.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
    property int anchorYear: new Date().getFullYear()
28
28
    readonly property int currentYear: yearPathView.currentItem.year
 
29
 
29
30
    signal monthSelected(var date);
30
31
 
31
 
    Keys.forwardTo: [yearPathView]
32
 
 
33
 
    function refreshCurrentYear(year) {
34
 
        currentYear = year;
35
 
        var yearViewDelegate = yearPathView.currentItem.item;
 
32
    function refreshCurrentYear(year)
 
33
    {
 
34
        anchorYear = year;
 
35
        var yearViewDelegate = yearPathView.currentItem;
36
36
        yearViewDelegate.refresh();
37
37
    }
38
38
 
47
47
        }
48
48
    }
49
49
 
 
50
    Keys.forwardTo: [yearPathView]
50
51
    title: i18n.tr("Year %1").arg(currentYear)
51
52
 
52
53
    head {
77
78
            scrollMonth: 0;
78
79
            isCurrentItem: (index == yearPathView.currentIndex)
79
80
            year: (anchorYear + yearPathView.loopCurrentIndex + yearPathView.indexType(index))
 
81
            onMonthSelected: {
 
82
                yearViewPage.monthSelected(date)
 
83
            }
80
84
        }
81
85
    }
82
86
}