62
62
currentYear = currentYear - 1;
68
focus: index == yearPathView.currentIndex
70
property int scrollMonth: 0;
71
property bool isCurrentItem: index == yearPathView.currentIndex
72
property int year: (yearViewPage.currentYear + yearPathView.indexType(index))
74
66
width: parent.width
75
67
height: parent.height
76
68
anchors.top: parent.top
78
readonly property int minCellWidth: units.gu(30)
79
cellWidth: Math.floor(Math.min.apply(Math, [3, 4].map(function(n)
80
{ return ((width / n >= minCellWidth) ? width / n : width / 2) })))
82
cellHeight: cellWidth * 1.4
84
model: 12 /* months in a year */
88
var today = new Date();
89
if(year == today.getFullYear()) {
90
scrollMonth = today.getMonth();
92
yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
95
//scroll in case content height changed
97
yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
100
Component.onCompleted: {
101
yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
108
if(scrollMonth < 0) {
111
yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
116
var visibleMonths = yearView.height / cellHeight;
117
if( scrollMonth >= (11 - visibleMonths)) {
118
scrollMonth = (11 - visibleMonths);
120
yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
125
width: yearView.cellWidth
126
height: yearView.cellHeight
70
asynchronous: index !== yearPathView.currentIndex
71
sourceComponent: delegateComponent
77
focus: index == yearPathView.currentIndex
80
isCurrentItem: index == yearPathView.currentIndex
81
year: (yearViewPage.currentYear + yearPathView.indexType(index))
129
83
anchors.fill: parent
130
anchors.margins: units.gu(0.5)
135
objectName: "monthComponent" + index
137
currentMonth: new Date(yearView.year, index, 1, 0, 0, 0, 0)
142
dayLabelFontSize:"x-small"
143
dateLabelFontSize: "medium"
144
monthLabelFontSize: "medium"
145
yearLabelFontSize: "small"
148
yearViewPage.monthSelected(date);