51
49
commonHeaderActions.reloadAction
56
objectName:"monthYearLabel"
58
text: i18n.tr(currentDay.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy")))
59
font.capitalization: Font.Capitalize
53
width: parent ? parent.width - units.gu(2) : undefined
57
text: Qt.locale().standaloneDayName(currentDay.getDay())
58
font.capitalization: Font.Capitalize
63
objectName:"monthYearLabel"
65
// TRANSLATORS: this is a time formatting string,
66
// see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
67
// It's used in the header of the day view
68
text:i18n.tr(currentDay.toLocaleString(Qt.locale(),i18n.tr("MMMM dd, yyyy")))
75
objectName: "dayViewPath"
77
property var startDay: currentDay
78
//This is used to scroll all view together when currentItem scrolls
79
property var childContentY;
64
81
anchors.fill: parent
65
anchors.topMargin: units.gu(1)
70
objectName: "dayHeader"
83
onNextItemHighlighted: {
85
currentDay = currentDay.addDays(1);
88
onPreviousItemHighlighted: {
90
currentDay = currentDay.addDays(-1);
93
delegate: TimeLineBaseComponent {
95
objectName: "DayComponent-"+index
71
97
type: ViewType.ViewTypeDay
72
currentDay: dayViewPage.currentDay
75
dayViewPage.currentDay = date;
76
dayViewPage.dateSelected(date);
79
onCurrentDayChanged: {
80
date = dayViewPage.currentDay.weekStart(Qt.locale().firstDayOfWeek);
84
if(currentDay >= date.addDays(7)) {
85
date = dayViewPage.currentDay.weekStart(Qt.locale().firstDayOfWeek);
86
dayHeader.incrementCurrentIndex();
90
function previousDay() {
91
if( currentDay < date) {
92
date = dayViewPage.currentDay.weekStart(Qt.locale().firstDayOfWeek);
93
dayHeader.decrementCurrentIndex();
100
objectName: "dayViewPath"
102
property var startDay: currentDay
103
//This is used to scroll all view together when currentItem scrolls
104
property var childContentY;
106
99
width: parent.width
107
height: dayViewPage.height - dayViewPath.y
109
onNextItemHighlighted: {
111
currentDay = currentDay.addDays(1);
115
onPreviousItemHighlighted: {
117
currentDay = currentDay.addDays(-1);
118
dayHeader.previousDay();
123
height: parent.height
124
asynchronous: !dayViewPath.isCurrentItem
125
sourceComponent: delegateComponent
128
id: delegateComponent
130
TimeLineBaseComponent {
132
objectName: "DayComponent-"+index
134
type: ViewType.ViewTypeDay
137
isActive: parent.PathView.isCurrentItem
138
contentInteractive: parent.PathView.isCurrentItem
139
startDay: dayViewPath.startDay.addDays(dayViewPath.indexType(index))
140
keyboardEventProvider: dayViewPath
142
Component.onCompleted: {
143
if(dayViewPage.isCurrentPage){
144
timeLineView.scrollToCurrentTime();
150
onIsCurrentPageChanged:{
151
if(dayViewPage.isCurrentPage){
152
timeLineView.scrollToCurrentTime();
157
//get contentY value from PathView, if its not current Item
161
value: dayViewPath.childContentY;
162
when: !parent.PathView.isCurrentItem
165
//set PathView's contentY property, if its current item
168
property: "childContentY"
170
when: parent.PathView.isCurrentItem
100
height: parent.height
101
z: index == dayViewPath.currentIndex ? 2 : 1
106
onIsCurrentPageChanged:{
107
if(dayViewPage.isCurrentPage){
108
timeLineView.scrollToCurrentTime();
113
//get contentY value from PathView, if its not current Item
117
value: dayViewPath.childContentY;
118
when: !timeLineView.PathView.isCurrentItem
121
//set PathView's contentY property, if its current item
124
property: "childContentY"
126
when: timeLineView.PathView.isCurrentItem
129
contentInteractive: timeLineView.PathView.isCurrentItem
131
startDay: dayViewPath.startDay.addDays(dayViewPath.indexType(index))