Merge lp:~pkunal-parmar/ubuntu-calendar-app/new_week_day_view into lp:ubuntu-calendar-app

Proposed by Kunal Parmar
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 104
Merged at revision: 109
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/new_week_day_view
Merge into: lp:ubuntu-calendar-app
Diff against target: 1655 lines (+377/-1093)
17 files modified
DayComponent.qml (+0/-107)
DayView.qml (+25/-68)
DiaryView.qml (+0/-47)
DiaryViewDelegate.qml (+0/-171)
EventBubble.qml (+109/-0)
EventView.qml (+0/-95)
EventViewBase.qml (+0/-70)
MonthComponent.qml (+3/-3)
TimeLineBackground.qml (+3/-2)
TimeLineBase.qml (+1/-4)
TimeLineBaseComponent.qml (+101/-0)
TimeLineHeader.qml (+117/-0)
TimeLineView.qml (+0/-206)
WeekComponent.qml (+0/-130)
WeekRibbon.qml (+0/-138)
WeekView.qml (+14/-52)
calendar.qml (+4/-0)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/new_week_day_view
Reviewer Review Type Date Requested Status
Olivier Tilloy (community) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+183879@code.launchpad.net

Commit message

New day view and week view created,
Theme applied according to UDS presentation
Removed unused files

Description of the change

New day view and week view created,
Theme applied according to UDS presentation
Removed unused files

To post a comment you must log in.
102. By Kunal Parmar

unused property removed

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

Jenkins says
" File "/usr/lib/python2.7/subprocess.py", line 1205, in _execute_child
    self.pid = os.fork()
OSError: [Errno 12] Cannot allocate memory
"

Is that caused by my changes ?

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

> Jenkins says
> " File "/usr/lib/python2.7/subprocess.py", line 1205, in _execute_child
> self.pid = os.fork()
> OSError: [Errno 12] Cannot allocate memory
> "
>
> Is that caused by my changes ?

No, that’s clearly an infrastructure problem with the jenkins setup.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Thanks Francis for fixing the virtual environment so this passed. Sorry for the trouble Kunal.

Revision history for this message
Olivier Tilloy (osomon) wrote :

506 + var startTime= Qt.formatDateTime(event.startTime,"hh:mm");
507 + var endTime= Qt.formatDateTime(event.endTime,"hh:mm");
508 +
509 + timeLabel.text = ""
510 + titleLabel.text = ""
511 + descriptionLabel.text = ""
512 +
513 + if( type == wideType) {
514 + timeLabel.text = startTime +" - "+ endTime

The format for startTime and endTime should be internationalized, to give translators a chance to change it based on locale. I think it is safe to assume that we want the same format for both startTime and endTime, so you should have only one call to i18n.tr(…) to assign the format to a variable. Please add a comment for translators, too.

Then the value of timeLabel should be formatted using string formatting, not concatenation, and it should be internationalized too (with a comment for translators):

    timeLabel.text = i18n.tr("%1 - %2").arg(startTime).arg(endTime)

review: Needs Fixing
Revision history for this message
Olivier Tilloy (osomon) wrote :

Looks pretty good, nice job Kunal!

One functional issue that I’ve discovered while testing: if I open the day view and swipe to Sunday the 1st of September 2013, the month displayed in the top ribbon is August, not September.

review: Needs Fixing
103. By Kunal Parmar

internationalized the time string

104. By Kunal Parmar

month label at dayview fixed

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> 506 + var startTime= Qt.formatDateTime(event.startTime,"hh:mm");
> 507 + var endTime= Qt.formatDateTime(event.endTime,"hh:mm");
> 508 +
> 509 + timeLabel.text = ""
> 510 + titleLabel.text = ""
> 511 + descriptionLabel.text = ""
> 512 +
> 513 + if( type == wideType) {
> 514 + timeLabel.text = startTime +" - "+ endTime
>
> The format for startTime and endTime should be internationalized, to give
> translators a chance to change it based on locale. I think it is safe to
> assume that we want the same format for both startTime and endTime, so you
> should have only one call to i18n.tr(…) to assign the format to a variable.
> Please add a comment for translators, too.
>
> Then the value of timeLabel should be formatted using string formatting, not
> concatenation, and it should be internationalized too (with a comment for
> translators):
>
> timeLabel.text = i18n.tr("%1 - %2").arg(startTime).arg(endTime)

ok, I just merged the change, please have look, if that is what you wanted...

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> Looks pretty good, nice job Kunal!
>
> One functional issue that I’ve discovered while testing: if I open the day
> view and swipe to Sunday the 1st of September 2013, the month displayed in the
> top ribbon is August, not September.
Right, I was using wrong date, now it should work.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

Looks good now. I’m not entirely sure I understand why adding one day when in day view fixes the issue, but it seems to fix it indeed.

On a related note, I’ve been playing a bit with the views, and it feels weird to me that the top part of the ribbon is moving when swiping. I would say that the first line (which displays month and year) should remain static, while the rest moves. This is something that can be changed later on though, let’s discuss it with design when we get a chance.

Revision history for this message
Olivier Tilloy (osomon) :
review: Approve
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> Looks good now. I’m not entirely sure I understand why adding one day when in
> day view fixes the issue, but it seems to fix it indeed.

Actually for DayView, TimeLineHeader's startDay is one day less then current date or required date.
So adding one makes it required date.

Revision history for this message
Olivier Tilloy (osomon) wrote :

> > Looks good now. I’m not entirely sure I understand why adding one day when
> in
> > day view fixes the issue, but it seems to fix it indeed.
>
> Actually for DayView, TimeLineHeader's startDay is one day less then current
> date or required date.
> So adding one makes it required date.

Got it, that makes sense!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file 'DayComponent.qml'
2--- DayComponent.qml 2013-09-03 15:15:35 +0000
3+++ DayComponent.qml 1970-01-01 00:00:00 +0000
4@@ -1,107 +0,0 @@
5-import QtQuick 2.0
6-import Ubuntu.Components 0.1
7-
8-import "dateExt.js" as DateExt
9-import "dataService.js" as DataService
10-
11-Flickable{
12- id: timeLineView
13-
14- property var day: new Date()
15- property int weekWidth:0;
16-
17- contentHeight: timeLineColumn.height
18- contentWidth: width
19-
20- clip: true
21-
22- onDayChanged: {
23- scroll();
24- }
25-
26- //scroll in case content height changed
27- onContentHeightChanged: {
28- scroll()
29- }
30-
31- function scroll() {
32- //scroll to 9 o'clock or to now
33- var now = new Date();
34- var hour = 9
35- if( day !== undefined
36- && now.isSameDay(day)) {
37- hour = now.getHours();
38- }
39-
40- timeLineView.contentY = hour * units.gu(10);
41- if(timeLineView.contentY >= timeLineView.contentHeight - timeLineView.height) {
42- timeLineView.contentY = timeLineView.contentHeight - timeLineView.height
43- }
44- }
45-
46- Rectangle{
47- id: background;
48- anchors.fill: parent
49- color: "white"
50- }
51-
52- TimeLineBackground{
53- id: timeLineColumn
54- anchors.top: parent.top
55- width: parent.width
56- }
57-
58- TimeLineBase {
59- id: bubbleOverLay
60- objectName: "timeLineBase"
61-
62- width: timeLineColumn.width
63- height: timeLineColumn.height
64- anchors.top: parent.top
65- delegate: infoBubbleComponent
66- day: timeLineView.day
67- }
68-
69- Component{
70- id: infoBubbleComponent
71- Rectangle{
72- id: infoBubble
73-
74- property string title;
75- property string location;
76- property int hour;
77- property var event;
78-
79- signal clicked(var event);
80-
81- color:'#fffdaa';
82- width: timeLineView.width - units.gu(8)
83- x: units.gu(5)
84-
85- border.color: "#f4d690"
86-
87- Column{
88- id: column
89- anchors {
90- left: parent.left
91- right: parent.right
92- top: parent.top
93-
94- leftMargin: units.gu(1)
95- rightMargin: units.gu(1)
96- topMargin: units.gu(1)
97- }
98- spacing: units.gu(1)
99- Label{text:infoBubble.title;fontSize:"medium";color:"black"}
100- Label{text:infoBubble.location; fontSize:"small"; color:"black"}
101- }
102-
103- MouseArea{
104- anchors.fill: parent
105- onClicked: {
106- infoBubble.clicked(infoBubble.event);
107- }
108- }
109- }
110- }
111-}
112
113=== modified file 'DayView.qml'
114--- DayView.qml 2013-08-31 00:13:30 +0000
115+++ DayView.qml 2013-09-05 13:15:05 +0000
116@@ -12,96 +12,53 @@
117
118 property var currentDay: new Date()
119
120- onCurrentDayChanged:{
121- weekRibbon.visibleWeek = currentDay.weekStart(Qt.locale().firstDayOfWeek);
122- weekRibbon.setSelectedDay(currentDay);
123- }
124-
125- Label{
126- id: todayLabel
127- text: Qt.formatDateTime( new Date(),"d MMMM yyyy");
128- fontSize: "large"
129- width: parent.width
130- }
131-
132- Label{
133- id: timeLabel;visible: false
134- text: new Date(0, 0, 0, 0).toLocaleTimeString(Qt.locale(), i18n.tr("HH"))
135- }
136-
137- WeekRibbon{
138- id: weekRibbon
139- visibleWeek: currentDay.weekStart(Qt.locale().firstDayOfWeek);
140- anchors.top: todayLabel.bottom
141- anchors.left: timeLabel.right
142- width: parent.width
143- height: units.gu(10)
144- //removing timeLabel.width from front and back of ribbon
145- weekWidth: ((width - 2* timeLabel.width )/ 7 )
146-
147- onWeekChanged: {
148- currentDay = visibleWeek
149- }
150-
151- onDaySelected: {
152- currentDay = day;
153- }
154- }
155-
156 PathViewBase{
157- id: weekViewPath
158- objectName:"DayViewPathBase"
159-
160- property var visibleDay: currentDay;
161-
162- QtObject{
163- id: intern
164- property var startDay: weekViewPath.visibleDay.addDays(-1)
165- }
166-
167- anchors.top: weekRibbon.bottom
168+ id: dayViewPath
169+ objectName: "DayViewPathBase"
170+
171+ property var startDay: currentDay.addDays(-1)
172+
173+ anchors.top: parent.top
174+ anchors.topMargin: units.gu(1.5)
175+
176 width: parent.width
177- height: parent.height - weekRibbon.height - units.gu(3)
178+ height: parent.height - units.gu(3)
179
180 onNextItemHighlighted: {
181- nextDay();
182+ //next day
183+ currentDay = currentDay.addDays(1);
184 }
185
186 onPreviousItemHighlighted: {
187- previousDay();
188- }
189-
190- function nextDay() {
191- currentDay = visibleDay.addDays(1);
192- }
193-
194- function previousDay(){
195- currentDay = visibleDay.addDays(-1);
196- }
197-
198- delegate: DayComponent {
199+ //previous day
200+ currentDay = currentDay.addDays(-1);
201+ }
202+
203+ delegate: TimeLineBaseComponent {
204 id: timeLineView
205 objectName: "DayComponent-"+index
206
207+ type: typeDay
208+
209 width: parent.width
210 height: parent.height
211- weekWidth: weekRibbon.weekWidth
212- day: getStartDay();
213+
214+ startDay: getStartDay().addDays(-1);
215
216 function getStartDay() {
217 //previous page
218- if (index === weekViewPath.currentIndex) {
219- return intern.startDay;
220+ if (index === dayViewPath.currentIndex) {
221+ return dayViewPath.startDay;
222 }
223
224 //next page
225- var previousIndex = weekViewPath.currentIndex > 0 ? weekViewPath.currentIndex - 1 : 2
226+ var previousIndex = dayViewPath.currentIndex > 0 ? dayViewPath.currentIndex - 1 : 2
227 if ( index === previousIndex ) {
228- return intern.startDay.addDays(2);
229+ return dayViewPath.startDay.addDays(2);
230 }
231
232 //current page
233- return intern.startDay.addDays(1);
234+ return dayViewPath.startDay.addDays(1);
235 }
236 }
237 }
238
239=== removed file 'DiaryView.qml'
240--- DiaryView.qml 2013-06-01 11:53:11 +0000
241+++ DiaryView.qml 1970-01-01 00:00:00 +0000
242@@ -1,47 +0,0 @@
243-import QtQuick 2.0
244-import Ubuntu.Components 0.1
245-import Ubuntu.Components.ListItems 0.1 as ListItem
246-
247-import "dateExt.js" as DateExt
248-import "colorUtils.js" as Color
249-
250-EventViewBase{
251- id: root
252-
253- flickableChild: diaryView
254-
255- ListView {
256- id: diaryView
257-
258- model: root.eventModel
259- anchors.fill: parent
260-
261- section {
262- property: "category"
263- // labelPositioning: ViewSection.CurrentLabelAtStart // FIXME, unreliable
264- delegate: ListItem.Header {
265- text: i18n.tr(section)
266- MouseArea {
267- anchors.fill: parent
268- onClicked: {
269- if (expanded)
270- compress()
271- else
272- expand()
273- }
274- }
275- }
276- }
277-
278- delegate: DiaryViewDelegate{
279- onClicked: {
280- pageStack.push(Qt.resolvedUrl("EventDetails.qml"),{event:diaryView.model.get(index)});
281- }
282- }
283-
284- footer: ListItem.Standard {
285- text: i18n.tr("(+) New Event")
286- onClicked: newEvent()
287- }
288- }
289-}
290
291=== removed file 'DiaryViewDelegate.qml'
292--- DiaryViewDelegate.qml 2013-06-01 12:25:52 +0000
293+++ DiaryViewDelegate.qml 1970-01-01 00:00:00 +0000
294@@ -1,171 +0,0 @@
295-import QtQuick 2.0
296-import Ubuntu.Components 0.1
297-
298-import "dataService.js" as DataService
299-
300-Item {
301- id: delegateRoot
302-
303- property color textColor: "black"
304- //property color bgColor: "#f1f1f1";
305- property color bgColor: "white";
306-
307- signal clicked(int index);
308-
309- function collapse( collapse ) {
310- attendeesLayout.visible = !collapse;
311- locationLayout.visible = !collapse;
312- eventRoot.collapsed = collapse;
313- }
314-
315- function showEventData() {
316- // FIXME: remove test value, need to decide what to do if there is no location, hide it ?
317- var venues = [{"name":"Test Venue"}]
318- DataService.getVenues(diaryView.model.get(index), venues)
319- if( venues.length > 0 ) {
320- locationLabel.text = venues[0].name;
321- }
322-
323- // FIXME: remove test value, need to decide what to do if there are no attendees, hide it ?
324- var attendees = ["Test One","Test Two"]
325- DataService.getAttendees(diaryView.model.get(index),attendees)
326- attendeeLabel.text = attendees.toString();
327- }
328-
329- function dataChanged() {
330- collapse(true);
331-
332- var now = new Date;
333- var lastEvent = diaryView.model.get(index-1);
334-
335- if( endTime >= now
336- && (lastEvent === undefined || lastEvent.endTime < now )
337- && endTime.isSameDay(now) ) {
338- collapse(false);
339- bgColor = "#fffdaa";
340- seperator.visible = true;
341- } else if( startTime < now) {
342- textColor = "#747474"
343- }
344-
345- showEventData();
346- }
347-
348- height: eventRoot.height + seperator.height + (seperator.visible ? units.gu(1.5) : units.gu(0.5)) /*margins*/
349- width: parent.width
350-
351- TimeSeparator {
352- id: seperator
353- width: delegateRoot.width - units.gu(2)
354- anchors.top: parent.top
355- anchors.topMargin: units.gu(1)
356- anchors.horizontalCenter: parent.horizontalCenter
357- visible: false
358- }
359-
360- Rectangle {
361- id: eventRoot
362-
363- property var event;
364- property bool collapsed: false;
365-
366- color: delegateRoot.bgColor;
367- height: eventContainer.height;
368- width: parent.width - units.gu(2)
369-
370- anchors {
371- top: seperator.visible ? seperator.bottom : parent.top
372- topMargin: units.gu(1)
373- horizontalCenter: parent.horizontalCenter
374- }
375-
376- MouseArea{
377- anchors.fill: parent;
378- onClicked: {
379- delegateRoot.clicked(index);
380- }
381- }
382-
383- Column{
384- id: eventContainer
385-
386- spacing: units.gu(1)
387-
388- anchors {
389- left: parent.left
390- right: parent.right
391- leftMargin: units.gu(1)
392- rightMargin: units.gu(1)
393- }
394-
395- Row{
396- width:parent.width
397- spacing: units.gu(2)
398- height: timeLabel.height + units.gu(3)
399-
400- Label{
401- id:timeLabel
402- fontSize: "large"
403- text: Qt.formatTime(startTime,"hh:mm");
404- anchors.verticalCenter: parent.verticalCenter
405- color: delegateRoot.textColor
406-
407- onTextChanged: {
408- delegateRoot.dataChanged();
409- }
410- }
411-
412- Label{
413- id: titleLabel
414- fontSize: "large"
415- text: title
416- anchors.verticalCenter: parent.verticalCenter
417- color: delegateRoot.textColor
418- wrapMode: Text.Wrap
419- }
420- }
421-
422- Row{
423- id: locationLayout
424- width:parent.width
425- spacing: units.gu(2)
426- Item {
427- id: locationIconContainer
428- width: timeLabel.width
429- height: units.gu(4)
430- Image{
431- source: "icon-location.png"
432- anchors.right: parent.right
433- }
434- }
435- Label{
436- id: locationLabel
437- width: parent.width - units.gu(2) - locationIconContainer.width
438- color: delegateRoot.textColor
439- wrapMode: Text.Wrap
440- }
441- }
442-
443- Row{
444- id: attendeesLayout
445- width:parent.width
446- spacing: units.gu(2)
447- Item {
448- id: contactIconContainer
449- width: timeLabel.width
450- height: units.gu(4)
451- Image{
452- source: "icon-contacts.png"
453- anchors.right: parent.right
454- }
455- }
456- Label{
457- id: attendeeLabel
458- width: parent.width - units.gu(2) - contactIconContainer.width
459- color: delegateRoot.textColor
460- wrapMode: Text.Wrap
461- }
462- }
463- }
464- }
465-}
466
467=== added file 'EventBubble.qml'
468--- EventBubble.qml 1970-01-01 00:00:00 +0000
469+++ EventBubble.qml 2013-09-05 13:15:05 +0000
470@@ -0,0 +1,109 @@
471+import QtQuick 2.0
472+import Ubuntu.Components 0.1
473+
474+import "dataService.js" as DataService
475+
476+Item{
477+ id: infoBubble
478+
479+ property var event;
480+
481+ property int type: narrowType
482+ property int wideType: 1;
483+ property int narrowType: 2;
484+
485+ signal clicked(var event);
486+
487+ UbuntuShape{
488+ id: bg
489+ anchors.fill: parent
490+ color: "white"
491+ }
492+
493+ onEventChanged: {
494+ setDetails();
495+ }
496+
497+ Component.onCompleted: {
498+ setDetails();
499+ }
500+
501+ function setDetails() {
502+ if(event === null || event === undefined) {
503+ return;
504+ }
505+
506+ // TRANSLATORS: this is a time formatting string,
507+ // see http://qt-project.org/doc/qt-5.0/qtqml/qml-qtquick2-date.html#details for valid expressions
508+ var timeFormat = i18n.tr("hh:mm");
509+ var startTime = event.startTime.toLocaleTimeString(Qt.locale(), timeFormat)
510+ var endTime = event.endTime.toLocaleTimeString(Qt.locale(), timeFormat)
511+ var timeString = i18n.tr("%1 - %2").arg(startTime).arg(endTime)
512+
513+ timeLabel.text = ""
514+ titleLabel.text = ""
515+ descriptionLabel.text = ""
516+
517+ if( type == wideType) {
518+ timeLabel.text = timeString
519+
520+ if( event.title)
521+ titleLabel.text = event.title;
522+
523+ if( event.message)
524+ descriptionLabel.text = event.message
525+ } else {
526+ timeLabel.text = startTime
527+ }
528+ }
529+
530+ Column{
531+ width: parent.width
532+ Row{
533+ width: parent.width
534+
535+ Rectangle{
536+ width: units.gu(1)
537+ radius: width/2
538+ height: width
539+ color: "#715772"
540+ anchors.verticalCenter: parent.verticalCenter
541+ antialiasing: true
542+ }
543+
544+ Label{
545+ id: timeLabel
546+ fontSize:"small";
547+ color:"gray"
548+ width: parent.width
549+ }
550+ }
551+
552+ Label{
553+ id: titleLabel
554+ x: units.gu(1)
555+ fontSize:"small";
556+ color:"black"
557+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
558+ width: parent.width
559+ visible: type == wideType
560+ }
561+
562+ Label{
563+ id: descriptionLabel
564+ x: units.gu(1)
565+ fontSize:"small";
566+ color:"gray"
567+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
568+ width: parent.width
569+ visible: type == wideType
570+ }
571+ }
572+
573+ MouseArea{
574+ anchors.fill: parent
575+ onClicked: {
576+ infoBubble.clicked(event);
577+ }
578+ }
579+}
580
581=== removed file 'EventView.qml'
582--- EventView.qml 2013-06-08 10:35:06 +0000
583+++ EventView.qml 1970-01-01 00:00:00 +0000
584@@ -1,95 +0,0 @@
585-import QtQuick 2.0
586-import Ubuntu.Components 0.1
587-import "dateExt.js" as DateExt
588-
589-PathView {
590- id: eventView
591-
592- property var currentDayStart: (new Date()).midnight()
593- property string eventViewType: "DiaryView.qml";
594-
595- signal incrementCurrentDay
596- signal decrementCurrentDay
597-
598- signal newEvent()
599-
600- QtObject {
601- id: intern
602- property int currentIndexSaved: 0
603- property int currentIndex: 0
604- property var currentDayStart: (new Date()).midnight()
605- }
606-
607- onCurrentIndexChanged: {
608- var delta = currentIndex - intern.currentIndexSaved
609- if (intern.currentIndexSaved == count - 1 && currentIndex == 0) delta = 1
610- if (intern.currentIndexSaved == 0 && currentIndex == count - 1) delta = -1
611- intern.currentIndexSaved = currentIndex
612- if (delta > 0) incrementCurrentDay()
613- else decrementCurrentDay()
614- }
615-
616- onCurrentDayStartChanged: {
617- if (!moving) intern.currentDayStart = currentDayStart
618- }
619-
620- onMovementEnded: {
621- intern.currentDayStart = currentDayStart
622- intern.currentIndex = currentIndex
623- }
624-
625- preferredHighlightBegin: 0.5
626- preferredHighlightEnd: 0.5
627- highlightRangeMode: PathView.StrictlyEnforceRange
628-
629- path: Path {
630- startX: -eventView.width; startY: eventView.height / 2
631- PathLine { relativeX: eventView.width; relativeY: 0 }
632- PathLine { relativeX: eventView.width; relativeY: 0 }
633- PathLine { relativeX: eventView.width; relativeY: 0 }
634- }
635-
636- snapMode: PathView.SnapOneItem
637-
638- model: 3
639-
640- delegate: Loader {
641- id: eventViewDelegate
642-
643- width: eventView.width
644- height: eventView.height
645- source: eventView.eventViewType
646-
647- property var dayStart: {
648- if (index == intern.currentIndex) return intern.currentDayStart
649- var previousIndex = intern.currentIndex > 0 ? intern.currentIndex - 1 : 2
650- if (index === previousIndex) return intern.currentDayStart.addDays(-1)
651- return intern.currentDayStart.addDays(1)
652- }
653-
654- onLoaded: {
655- item.newEvent.connect(eventView.newEvent);
656- }
657-
658- Binding {
659- target: item
660- property: "dayStart"
661- value: eventViewDelegate.dayStart
662- }
663-
664- //share state from delegate to eventView, if state change is from current delegate
665- Binding {
666- target: eventView
667- property: "state"
668- value: eventViewDelegate.item.state;
669- when: index == eventView.currentIndex
670- }
671-
672- //share state from eventview to delegate, so that all delegate share the same state
673- Binding{
674- target: eventViewDelegate.item
675- property: "state"
676- value: eventView.state
677- }
678- }
679-}
680
681=== removed file 'EventViewBase.qml'
682--- EventViewBase.qml 2013-09-02 18:08:46 +0000
683+++ EventViewBase.qml 1970-01-01 00:00:00 +0000
684@@ -1,70 +0,0 @@
685-import QtQuick 2.0
686-import Ubuntu.Components 0.1
687-
688-import "dateExt.js" as DateExt
689-import "colorUtils.js" as Color
690-
691-Item {
692- id: baseView
693-
694- property var dayStart: new Date()
695- property alias eventModel: model;
696- property Flickable flickableChild;
697-
698- state: "COMPRESSED"
699-
700- signal newEvent()
701- signal modelRefreshed();
702-
703- clip: true
704-
705- EventListModel {
706- id: model
707- termStart: dayStart
708- termLength: Date.msPerDay
709-
710- onReloaded: {
711- modelRefreshed();
712- }
713- }
714-
715- Connections{
716- target: flickableChild
717-
718- onContentYChanged: {
719- if (state == "COMPRESSING" || state == "EXPANDING" || !flickableChild.dragging ) return
720-
721- if ( state == "EXPANDED" && flickableChild.contentY < -units.gu(0.5) ) {
722- state = "COMPRESSING";
723- }
724- else if (flickableChild.contentY < -units.gu(0.5)) {
725- state = "EXPANDING";
726- }
727- }
728-
729- onDraggingChanged: {
730- if (flickableChild.dragging) return;
731-
732- if( state == "EXPANDING" ) {
733- state = "EXPANDED";
734- } else if ( state == "COMPRESSING") {
735- state = "COMPRESSED";
736- }
737- }
738- }
739-
740- states: [
741- State {
742- name: "EXPANDING"
743- },
744- State {
745- name: "COMPRESSING"
746- },
747- State {
748- name: "EXPANDED"
749- },
750- State {
751- name: "COMPRESSED"
752- }
753- ]
754-}
755
756=== modified file 'MonthComponent.qml'
757--- MonthComponent.qml 2013-09-03 23:46:17 +0000
758+++ MonthComponent.qml 2013-09-05 13:15:05 +0000
759@@ -11,8 +11,8 @@
760
761 property string dayLabelFontSize: "medium"
762 property string dateLabelFontSize: "large"
763- property string monthLabelFontSize: "large"
764- property string yearLabelFontSize: "medium"
765+ property string monthLabelFontSize: "x-large"
766+ property string yearLabelFontSize: "large"
767
768 property alias dayLabelDelegate : dayLabelRepeater.delegate
769 property alias dateLabelDelegate : dateLabelRepeater.delegate
770@@ -127,7 +127,7 @@
771 if( date.isSameDay(DateExt.today()) && isCurrentMonth ) {
772 "#2C001E"
773 } else if( parent.isCurrentMonth ) {
774- "#333333"
775+ "white"
776 } else {
777 "#AEA79F"
778 }
779
780=== modified file 'TimeLineBackground.qml'
781--- TimeLineBackground.qml 2013-09-02 14:02:45 +0000
782+++ TimeLineBackground.qml 2013-09-05 13:15:05 +0000
783@@ -9,13 +9,14 @@
784 delegate: Rectangle {
785 width: parent.width
786 height: units.gu(10)
787- color: ( index % 2 == 0) ? "#e5dbe6" : "#e6e4e9"
788+ color: ( index % 2 == 0) ? "#4c875b" : "#86c07f"
789 Label{
790 id: timeLabel
791+
792 // TRANSLATORS: this is a time formatting string,
793 // see http://qt-project.org/doc/qt-5.0/qtqml/qml-qtquick2-date.html#details for valid expressions
794 text: new Date(0, 0, 0, index).toLocaleTimeString(Qt.locale(), i18n.tr("hh ap"))
795- color:"gray"
796+ color:"white"
797 anchors.horizontalCenter: parent.horizontalCenter
798 anchors.verticalCenter: parent.verticalCenter
799 fontSize: "x-large"
800
801=== modified file 'TimeLineBase.qml'
802--- TimeLineBase.qml 2013-09-03 16:03:58 +0000
803+++ TimeLineBase.qml 2013-09-05 13:15:05 +0000
804@@ -65,10 +65,7 @@
805
806 eventBubble.clicked.connect( bubbleOverLay.showEventDetails );
807
808- eventBubble.event = event;
809- eventBubble.title = event.title;
810- eventBubble.location = "Test"//event.location;
811- eventBubble.hour = hour;
812+ eventBubble.event = event
813
814 var yPos = (( event.startTime.getMinutes() * hourHeight) / 60) + hour * hourHeight
815 eventBubble.y = yPos;
816
817=== added file 'TimeLineBaseComponent.qml'
818--- TimeLineBaseComponent.qml 1970-01-01 00:00:00 +0000
819+++ TimeLineBaseComponent.qml 2013-09-05 13:15:05 +0000
820@@ -0,0 +1,101 @@
821+import QtQuick 2.0
822+import Ubuntu.Components 0.1
823+
824+import "dateExt.js" as DateExt
825+
826+Item {
827+ id: root
828+
829+ property var startDay: DateExt.today();
830+
831+ property int type: typeWeek
832+
833+ readonly property int typeWeek: 0
834+ readonly property int typeDay: 1
835+
836+ onStartDayChanged: {
837+ timeLineView.scroll();
838+ }
839+
840+ //scroll in case content height changed
841+ onHeightChanged: {
842+ timeLineView.scroll()
843+ }
844+
845+ TimeLineHeader{
846+ id: header
847+ type: root.type
848+ anchors.top: parent.top
849+ startDay: root.startDay
850+ }
851+
852+ Flickable{
853+ id: timeLineView
854+
855+ anchors.top: header.bottom
856+ width: parent.width
857+ height: parent.height - header.height
858+
859+ contentHeight: units.gu(10) * 24
860+ contentWidth: width
861+
862+ clip: true
863+
864+ function scroll() {
865+ //scroll to 9 o'clock
866+ var hour = 9
867+
868+ timeLineView.contentY = hour * units.gu(10);
869+ if(timeLineView.contentY >= timeLineView.contentHeight - timeLineView.height) {
870+ timeLineView.contentY = timeLineView.contentHeight - timeLineView.height
871+ }
872+ }
873+
874+ TimeLineBackground{
875+ }
876+
877+ Row{
878+ id: week
879+ width: parent.width
880+ height: parent.height
881+ anchors.top: parent.top
882+
883+ Repeater{
884+ model: type == typeWeek ? 7 : 3
885+
886+ delegate: TimeLineBase {
887+ property int idx: index
888+ anchors.top: parent.top
889+ width: {
890+ if( type == typeWeek || (type == typeDay && index != 1 ) ) {
891+ header.width/7
892+ } else {
893+ (header.width/7) * 5
894+ }
895+ }
896+ height: parent.height
897+ delegate: comp
898+ day: startDay.addDays(index)
899+ }
900+ }
901+ }
902+ }
903+
904+ Component{
905+ id: comp
906+ EventBubble{
907+ type: {
908+ if( root.type == typeWeek
909+ || (root.type == typeDay && parent.idx !== 1) ) {
910+ narrowType
911+ } else {
912+ wideType
913+ }
914+ }
915+ anchors.left: parent.left
916+ anchors.right: parent.right
917+ anchors.leftMargin: units.gu(0.1)
918+ anchors.rightMargin: units.gu(0.1)
919+ }
920+ }
921+}
922
923=== added file 'TimeLineHeader.qml'
924--- TimeLineHeader.qml 1970-01-01 00:00:00 +0000
925+++ TimeLineHeader.qml 2013-09-05 13:15:05 +0000
926@@ -0,0 +1,117 @@
927+import QtQuick 2.0
928+import Ubuntu.Components 0.1
929+
930+import "dateExt.js" as DateExt
931+
932+Column {
933+ id: root
934+
935+ property int type: typeWeek
936+
937+ property var startDay: DateExt.today();
938+
939+ readonly property int typeWeek: 0
940+ readonly property int typeDay: 1
941+
942+ clip: true
943+
944+ width: parent.width
945+
946+ Item{
947+ id: monthHeader
948+ width: parent.width
949+ height: monthLabel.height
950+
951+ Label{
952+ id: monthLabel
953+ fontSize: "large"
954+ text: {
955+ var monthDate = startDay;
956+ if( type === typeDay ) {
957+ monthDate = monthDate.addDays(1)
958+ }
959+ Qt.locale().standaloneMonthName(monthDate.getMonth())
960+ }
961+ anchors.leftMargin: units.gu(1)
962+ anchors.left: parent.left
963+ //color:"white"
964+ anchors.verticalCenter: parent.verticalCenter
965+ }
966+
967+ Label{
968+ id: yearLabel
969+ fontSize: "medium"
970+ text: root.startDay.getFullYear()
971+ anchors.right: parent.right
972+ anchors.rightMargin: units.gu(1)
973+ color:"#AEA79F"
974+ anchors.verticalCenter: parent.verticalCenter
975+ }
976+ }
977+
978+ Row{
979+ id: header
980+
981+ width: parent.width
982+ height: units.gu(10)
983+
984+ Repeater{
985+ model: type == typeWeek ? 7 : 3
986+
987+ delegate: Item {
988+ property var date : startDay.addDays(index);
989+ property int weekDayWidth: header.width / 7
990+
991+ width: {
992+ if( type == typeWeek || (type == typeDay && index != 1 ) ) {
993+ weekDayWidth
994+ } else {
995+ weekDayWidth * 5
996+ }
997+ }
998+
999+ height: parent.height
1000+
1001+ Column{
1002+ anchors.verticalCenter: parent.verticalCenter
1003+ anchors.horizontalCenter: parent.horizontalCenter
1004+ width: parent.width
1005+ spacing: units.gu(0.5)
1006+
1007+ Label{
1008+ property var day: {
1009+ if( type == typeWeek || (type == typeDay && index != 1 ) ) {
1010+ Qt.locale().standaloneDayName(date.getDay(), Locale.ShortFormat)
1011+ } else {
1012+ Qt.locale().standaloneDayName(date.getDay(), Locale.LongFormat)
1013+ }
1014+ }
1015+
1016+ text: day.toUpperCase();
1017+ fontSize: "medium"
1018+ horizontalAlignment: Text.AlignHCenter
1019+ color: "#AEA79F"
1020+ width: parent.width
1021+ }
1022+
1023+ Label{
1024+ text: date.getDate();
1025+ fontSize: "large"
1026+ horizontalAlignment: Text.AlignHCenter
1027+ color: {
1028+ if( type == typeDay && index == 1 ) {
1029+ "white"
1030+ } else if( type == typeWeek && date.isSameDay(DateExt.today())){
1031+ "white"
1032+ } else {
1033+ "#AEA79F"
1034+ }
1035+ }
1036+ width: parent.width
1037+ }
1038+ }
1039+ }
1040+ }
1041+ }
1042+}
1043+
1044
1045=== removed file 'TimeLineView.qml'
1046--- TimeLineView.qml 2013-07-18 18:48:26 +0000
1047+++ TimeLineView.qml 1970-01-01 00:00:00 +0000
1048@@ -1,206 +0,0 @@
1049-import QtQuick 2.0
1050-import Ubuntu.Components 0.1
1051-
1052-import "dateExt.js" as DateExt
1053-import "dataService.js" as DataService
1054-
1055-EventViewBase{
1056- id: root
1057-
1058- flickableChild: timeLineView
1059-
1060- onModelRefreshed: {
1061- timeLineView.createEvents();
1062- }
1063-
1064- Flickable{
1065- id: timeLineView
1066- anchors.fill: parent
1067-
1068- function scroll() {
1069- //scroll to first event or current hour
1070- var hour = intern.now.getHours();
1071- if( eventModel.count > 0) {
1072- hour = eventModel.get(0).startTime.getHours();
1073- }
1074-
1075- timeLineView.contentY = hour * intern.hourHeight;
1076-
1077- if(timeLineView.contentY >= timeLineView.contentHeight - timeLineView.height) {
1078- timeLineView.contentY = timeLineView.contentHeight - timeLineView.height
1079- }
1080- }
1081-
1082- function createEventMap() {
1083- var eventMap = {};
1084- for(var i = 0 ; i < eventModel.count ; ++i) {
1085- var event = eventModel.get(i);
1086- eventMap[event.startTime.getHours()] = event
1087- }
1088- return eventMap;
1089- }
1090-
1091- function createEvents() {
1092- intern.eventMap = createEventMap();
1093-
1094- bubbleOverLay.destroyAllChildren();
1095-
1096- for( var i=0; i < 24; ++i ) {
1097- var event = intern.eventMap[i];
1098- if( event ) {
1099- bubbleOverLay.createEvent(event,i);
1100- } else if( i === intern.now.getHours()
1101- && intern.now.isSameDay( root.dayStart )) {
1102- bubbleOverLay.createSeparator(i);
1103- }
1104- }
1105-
1106- scroll();
1107- }
1108-
1109- function showEventDetails(hour) {
1110- var event = intern.eventMap[hour];
1111- pageStack.push(Qt.resolvedUrl("EventDetails.qml"),{"event":event});
1112- }
1113-
1114- contentHeight: timeLineColumn.height + units.gu(3)
1115- contentWidth: width
1116-
1117- QtObject {
1118- id: intern
1119- property var eventMap;
1120- property var now : new Date();
1121- property var hourHeight : units.gu(10)
1122- }
1123-
1124- Rectangle{
1125- id: background; anchors.fill: parent
1126- color: "white"
1127- }
1128-
1129- //Time line view
1130- Column{
1131- id: timeLineColumn
1132- anchors.top: parent.top
1133- anchors.topMargin: units.gu(3)
1134- width: parent.width
1135-
1136- Repeater{
1137- model: 24 // hour in a day
1138-
1139- delegate: Item {
1140- id: delegate
1141- width: parent.width
1142- height: intern.hourHeight
1143-
1144- Row {
1145- width: parent.width
1146- y: -timeLabel.height/2
1147- Label{
1148- id: timeLabel
1149- // TRANSLATORS: this is a time formatting string,
1150- // see http://qt-project.org/doc/qt-5.0/qtqml/qml-qtquick2-date.html#details for valid expressions
1151- text: new Date(0, 0, 0, index).toLocaleTimeString(Qt.locale(), i18n.tr("HH"))
1152- color:"gray"
1153- anchors.top: parent.top
1154- }
1155- Rectangle{
1156- width: parent.width -timeLabel.width
1157- height:units.dp(1)
1158- color:"gray"
1159- anchors.verticalCenter: parent.verticalCenter
1160- }
1161- }
1162-
1163- Rectangle{
1164- width: parent.width - units.gu(5)
1165- height:units.dp(1)
1166- color:"gray"
1167- anchors.verticalCenter: parent.verticalCenter
1168- anchors.horizontalCenter: parent.horizontalCenter
1169- }
1170- }
1171- }
1172- }
1173-
1174- Item {
1175- id: bubbleOverLay
1176-
1177- width: timeLineColumn.width
1178- height: timeLineColumn.height
1179- anchors.top: parent.top
1180- anchors.topMargin: units.gu(3)
1181-
1182- function destroyAllChildren() {
1183- for( var i = children.length - 1; i >= 0; --i ) {
1184- children[i].destroy();
1185- }
1186- }
1187-
1188- function createEvent( event ,hour) {
1189- var eventBubble = infoBubbleComponent.createObject(bubbleOverLay);
1190- eventBubble.title = event.title;
1191- eventBubble.location = "test";
1192- eventBubble.hour = hour;
1193-
1194- var yPos = (( event.startTime.getMinutes() * intern.hourHeight) / 60) + hour * intern.hourHeight
1195- eventBubble.y = yPos;
1196-
1197- var durationMin = (event.endTime.getHours() - event.startTime.getHours()) * 60;
1198- durationMin += (event.endTime.getMinutes() - event.startTime.getMinutes());
1199- var height = (durationMin * intern.hourHeight )/ 60;
1200- eventBubble.height = height;
1201- }
1202-
1203- function createSeparator(hour) {
1204- var w = timeLineView.width - units.gu(2);
1205- var y = ((intern.now.getMinutes() * intern.hourHeight) / 60) + hour * intern.hourHeight;
1206- var x = (parent.width - w)/ 2;
1207- var properties = {"x": x, "y": y, "width": w}
1208-
1209- var component = Qt.createComponent("TimeSeparator.qml");
1210- var separator = component.createObject(bubbleOverLay, properties);
1211- }
1212- }
1213-
1214- Component{
1215- id: infoBubbleComponent
1216- Rectangle{
1217- id: infoBubble
1218-
1219- property string title;
1220- property string location;
1221- property int hour;
1222-
1223- color:'#fffdaa';
1224- width: timeLineView.width - units.gu(8)
1225- x: units.gu(5)
1226-
1227- border.color: "#f4d690"
1228-
1229- Column{
1230- id: column
1231- anchors {
1232- left: parent.left
1233- right: parent.right
1234- top: parent.top
1235-
1236- leftMargin: units.gu(1)
1237- rightMargin: units.gu(1)
1238- topMargin: units.gu(1)
1239- }
1240- spacing: units.gu(1)
1241- Label{text:infoBubble.title;fontSize:"medium";color:"black"}
1242- Label{text:infoBubble.location; fontSize:"small"; color:"black"}
1243- }
1244-
1245- MouseArea{
1246- anchors.fill: parent
1247- onClicked: {
1248- timeLineView.showEventDetails(hour);
1249- }
1250- }
1251- }
1252- }
1253- }
1254-}
1255
1256=== removed file 'WeekComponent.qml'
1257--- WeekComponent.qml 2013-09-03 15:15:35 +0000
1258+++ WeekComponent.qml 1970-01-01 00:00:00 +0000
1259@@ -1,130 +0,0 @@
1260-import QtQuick 2.0
1261-import Ubuntu.Components 0.1
1262-
1263-import "dateExt.js" as DateExt
1264-import "dataService.js" as DataService
1265-
1266-Flickable{
1267- id: timeLineView
1268-
1269- property var weekStart: new Date().midnight();
1270- property int weekWidth:0;
1271-
1272- contentHeight: timeLineColumn.height
1273- contentWidth: width
1274-
1275- clip: true
1276-
1277- onWeekStartChanged: {
1278- scroll();
1279- }
1280-
1281- function scroll() {
1282- //scroll to 9 o'clock or to now
1283- var now = new Date();
1284- var hour = 9
1285- if( weekStart !== undefined
1286- && now.weekStart(Qt.locale().firstDayOfWeek).isSameDay(weekStart)) {
1287- hour = now.getHours();
1288- }
1289-
1290- timeLineView.contentY = hour * units.gu(10);
1291- if(timeLineView.contentY >= timeLineView.contentHeight - timeLineView.height) {
1292- timeLineView.contentY = timeLineView.contentHeight - timeLineView.height
1293- }
1294- }
1295-
1296- //scroll in case content height changed
1297- onContentHeightChanged: {
1298- scroll()
1299- }
1300-
1301- Rectangle{
1302- id: background;
1303- anchors.fill: parent
1304- color: "white"
1305- }
1306-
1307- TimeLineBackground{
1308- id: timeLineColumn
1309- anchors.top: parent.top
1310- width: parent.width
1311- }
1312-
1313- //vertical lines for weeks
1314- Row{
1315- id: dayIndicator
1316-
1317- x: timeLabel.width
1318- width: parent.width
1319- height: timeLineView.contentHeight
1320-
1321- Repeater{
1322- model:7
1323- delegate: Rectangle{
1324- height: dayIndicator.height
1325- width: weekWidth
1326- border.color: "gray"
1327- opacity: 0.1
1328- }
1329- }
1330- }
1331-
1332- Row{
1333- id: week
1334- width: timeLineColumn.width - x
1335- height: timeLineColumn.height
1336- anchors.top: parent.top
1337- x: timeLabel.width
1338- spacing: 0
1339-
1340- property var weekStartDay: timeLineView.weekStart.weekStart( Qt.locale().firstDayOfWeek );
1341-
1342- Repeater{
1343- model: 7
1344-
1345- delegate: TimeLineBase {
1346- anchors.top: parent.top
1347- height: parent.height
1348- width: weekWidth
1349- delegate: infoBubbleComponent
1350- day: week.weekStartDay.addDays(index)
1351- }
1352- }
1353- }
1354-
1355- Component{
1356- id: infoBubbleComponent
1357- Rectangle{
1358- id: infoBubble
1359-
1360- property string title;
1361- property string location;
1362- property int hour;
1363- property var event;
1364-
1365- signal clicked(var event);
1366-
1367- color:'#fffdaa';
1368- width: weekWidth
1369- x: units.gu(0)
1370-
1371- border.color: "#f4d690"
1372-
1373- Label{
1374- text:infoBubble.title;
1375- fontSize:"small";
1376- color:"black"
1377- wrapMode: Text.WrapAtWordBoundaryOrAnywhere
1378- width: parent.width
1379- }
1380-
1381- MouseArea{
1382- anchors.fill: parent
1383- onClicked: {
1384- infoBubble.clicked(infoBubble.event);
1385- }
1386- }
1387- }
1388- }
1389-}
1390
1391=== removed file 'WeekRibbon.qml'
1392--- WeekRibbon.qml 2013-08-31 00:13:30 +0000
1393+++ WeekRibbon.qml 1970-01-01 00:00:00 +0000
1394@@ -1,138 +0,0 @@
1395-import QtQuick 2.0
1396-import Ubuntu.Components 0.1
1397-
1398-import "dateExt.js" as DateExt
1399-import "colorUtils.js" as Color
1400-
1401-PathViewBase{
1402- id: weekRibbonRoot
1403-
1404- property int weekWidth:0;
1405- property var visibleWeek: intern.now
1406-
1407- signal daySelected(var day);
1408- signal weekChanged(var visibleWeek);
1409-
1410- QtObject{
1411- id: intern
1412- property var now: new Date();
1413- property var weekStart: visibleWeek.addDays(-7)
1414- property var selectedDate: visibleWeek
1415- }
1416-
1417- onNextItemHighlighted: {
1418- nextWeek();
1419- }
1420-
1421- onPreviousItemHighlighted: {
1422- previousWeek();
1423- }
1424-
1425- onVisibleWeekChanged: {
1426- setSelectedDay();
1427- }
1428-
1429- Component.onCompleted: {
1430- setSelectedDay();
1431- }
1432-
1433- function nextWeek() {
1434- var weekStartDay= visibleWeek.weekStart(Qt.locale().firstDayOfWeek);
1435- visibleWeek = weekStartDay.addDays(7);
1436- setSelectedDay();
1437-
1438- weekChanged( visibleWeek );
1439- }
1440-
1441- function previousWeek(){
1442- var weekStartDay = visibleWeek.weekStart(Qt.locale().firstDayOfWeek);
1443- visibleWeek = weekStartDay.addDays(-7);
1444- setSelectedDay();
1445-
1446- weekChanged( visibleWeek );
1447- }
1448-
1449- function setSelectedDay(date) {
1450-
1451- if( date !== undefined && date !== null) {
1452- intern.selectedDate = date;
1453- return;
1454- }
1455-
1456- if( intern.now.weekStart(Qt.locale().firstDayOfWeek).isSameDay(visibleWeek) ) {
1457- intern.selectedDate = intern.now
1458- } else {
1459- intern.selectedDate = visibleWeek
1460- }
1461- }
1462-
1463- delegate: Row{
1464- id: dayLabelRow
1465- width: parent.width
1466-
1467- function getWeekStart() {
1468- if (index === weekRibbonRoot.currentIndex) {
1469- return intern.weekStart;
1470- }
1471- var previousIndex = weekRibbonRoot.currentIndex > 0 ? weekRibbonRoot.currentIndex - 1 : 2
1472-
1473- if ( index === previousIndex ) {
1474- var weekStartDay= intern.weekStart.weekStart( Qt.locale().firstDayOfWeek);
1475- return weekStartDay.addDays(-7);
1476- }
1477-
1478- var weekStartDay = intern.weekStart.weekStart( Qt.locale().firstDayOfWeek);
1479- return weekStartDay.addDays(7);
1480- }
1481-
1482- property var weekStart: getWeekStart();
1483-
1484- Repeater{
1485- id: dayLabelRepeater
1486- model:7
1487- delegate: dafaultDayLabelComponent
1488- }
1489- }
1490-
1491- Component{
1492- id: dafaultDayLabelComponent
1493-
1494- Rectangle{
1495- id: weekDay
1496-
1497- width: column.width
1498- height: column.height
1499-
1500- color: intern.selectedDate.isSameDay(day) ? Color.ubuntuOrange : "white"
1501-
1502- property var weekStartDay: parent.weekStart.weekStart( Qt.locale().firstDayOfWeek);
1503- property var day : weekStartDay.addDays(index)
1504-
1505- Column {
1506- id: column
1507- width: weekWidth
1508- Label{
1509- text: Qt.locale().standaloneDayName(( Qt.locale().firstDayOfWeek + index), Locale.ShortFormat)
1510- horizontalAlignment: Text.AlignHCenter
1511- width: column.width
1512- fontSize: "medium"
1513- }
1514- Label{
1515- text: weekDay.day.getDate()
1516- horizontalAlignment: Text.AlignHCenter
1517- width: column.width
1518- fontSize: "large"
1519- }
1520- }
1521-
1522- MouseArea{
1523- anchors.fill: parent
1524-
1525- onClicked: {
1526- weekRibbonRoot.setSelectedDay(day);
1527- weekRibbonRoot.daySelected(day);
1528- }
1529- }
1530- }
1531- }
1532-}
1533
1534=== modified file 'WeekView.qml'
1535--- WeekView.qml 2013-08-31 08:17:07 +0000
1536+++ WeekView.qml 2013-09-05 13:15:05 +0000
1537@@ -10,51 +10,16 @@
1538
1539 property var dayStart: new Date();
1540
1541- onDayStartChanged:{
1542- weekRibbon.visibleWeek = dayStart.weekStart(Qt.locale().firstDayOfWeek);
1543- weekViewPath.visibleWeek = dayStart.weekStart(Qt.locale().firstDayOfWeek);
1544- }
1545-
1546- Label{
1547- id: todayLabel
1548- text: Qt.formatDateTime( new Date(),"d MMMM yyyy");
1549- fontSize: "large"
1550- width: parent.width
1551- }
1552-
1553- Label{
1554- id: timeLabel;visible: false
1555- text: new Date(0, 0, 0, 0).toLocaleTimeString(Qt.locale(), i18n.tr("HH"))
1556- }
1557-
1558- WeekRibbon{
1559- id: weekRibbon
1560- visibleWeek: dayStart.weekStart(Qt.locale().firstDayOfWeek);
1561- anchors.top: todayLabel.bottom
1562- anchors.left: timeLabel.right
1563- width: parent.width
1564- height: units.gu(10)
1565- //removing timeLabel.width from front and back of ribbon
1566- weekWidth: ((width - 2* timeLabel.width )/ 7 )
1567-
1568- onWeekChanged: {
1569- dayStart = visibleWeek
1570- }
1571- }
1572-
1573 PathViewBase{
1574 id: weekViewPath
1575
1576 property var visibleWeek: dayStart.weekStart(Qt.locale().firstDayOfWeek);
1577-
1578- QtObject{
1579- id: intern
1580- property var weekStart: weekViewPath.visibleWeek.addDays(-7)
1581- }
1582-
1583- anchors.top: weekRibbon.bottom
1584+ property var weekStart: weekViewPath.visibleWeek.addDays(-7)
1585+
1586+ anchors.top: parent.top
1587+ anchors.topMargin: units.gu(1.5)
1588 width: parent.width
1589- height: parent.height - weekRibbon.height - units.gu(3)
1590+ height: parent.height - units.gu(3)
1591
1592 onNextItemHighlighted: {
1593 nextWeek();
1594@@ -66,38 +31,35 @@
1595
1596 function nextWeek() {
1597 var weekStartDay = visibleWeek.weekStart(Qt.locale().firstDayOfWeek);
1598- visibleWeek = weekStartDay.addDays(7);
1599-
1600- dayStart = visibleWeek
1601+ dayStart = weekStartDay.addDays(7);
1602 }
1603
1604 function previousWeek(){
1605 var weekStartDay = visibleWeek.weekStart(Qt.locale().firstDayOfWeek);
1606- visibleWeek = weekStartDay.addDays(-7);
1607-
1608- dayStart = visibleWeek
1609+ dayStart = weekStartDay.addDays(-7);
1610 }
1611
1612- delegate: WeekComponent {
1613+ delegate: TimeLineBaseComponent {
1614 id: timeLineView
1615
1616+ type: typeWeek
1617+
1618 width: parent.width
1619 height: parent.height
1620- weekWidth: weekRibbon.weekWidth
1621- weekStart: getWeekStart();
1622+ startDay: getWeekStart();
1623
1624 function getWeekStart() {
1625 if (index === weekViewPath.currentIndex) {
1626- return intern.weekStart;
1627+ return weekViewPath.weekStart;
1628 }
1629 var previousIndex = weekViewPath.currentIndex > 0 ? weekViewPath.currentIndex - 1 : 2
1630
1631 if ( index === previousIndex ) {
1632- var weekStartDay= intern.weekStart.weekStart(Qt.locale().firstDayOfWeek);
1633+ var weekStartDay= weekViewPath.weekStart.weekStart(Qt.locale().firstDayOfWeek);
1634 return weekStartDay.addDays(14);
1635 }
1636
1637- var weekStartDay = intern.weekStart.weekStart(Qt.locale().firstDayOfWeek);
1638+ var weekStartDay = weekViewPath.weekStart.weekStart(Qt.locale().firstDayOfWeek);
1639 return weekStartDay.addDays(7);
1640 }
1641 }
1642
1643=== modified file 'calendar.qml'
1644--- calendar.qml 2013-08-31 03:15:01 +0000
1645+++ calendar.qml 2013-09-05 13:15:05 +0000
1646@@ -13,6 +13,10 @@
1647 width: units.gu(45)
1648 height: units.gu(80)
1649
1650+ headerColor: "#266249"
1651+ backgroundColor: "#478158"
1652+ footerColor: "#478158"
1653+
1654 PageStack {
1655 id: pageStack
1656

Subscribers

People subscribed via source and target branches

to status/vote changes: