Merge lp:~dpniel/ubuntu-calendar-app/ScrollView2 into lp:ubuntu-calendar-app

Proposed by Dan Chapman  on 2016-02-04
Status: Work in progress
Proposed branch: lp:~dpniel/ubuntu-calendar-app/ScrollView2
Merge into: lp:ubuntu-calendar-app
Diff against target: 1313 lines (+555/-486)
4 files modified
NewEvent.qml (+305/-301)
TimeLineBaseComponent.qml (+133/-132)
YearView.qml (+20/-8)
po/com.ubuntu.calendar.pot (+97/-45)
To merge this branch: bzr merge lp:~dpniel/ubuntu-calendar-app/ScrollView2
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Needs Fixing on 2016-02-17
Ubuntu Calendar Developers 2016-02-04 Pending
Review via email: mp+285027@code.launchpad.net

Commit message

Adds ScrollView component to view Flickables

It's not possible to add the ScrollView to the PathView where used for
horizontal traversing, like in year view as Path doesn't inherit
Flickable. So another solution will Probably be needed for those areas.

Description of the change

Adds ScrollView component to view Flickables

It's not possible to add the ScrollView to the PathView where used for
horizontal traversing, like in year view as Path doesn't inherit
Flickable. So another solution will Probably be needed for those areas.

To post a comment you must log in.
review: Needs Fixing (continuous-integration)
759. By Dan Chapman  on 2016-02-04

Forward on yearviewdelegate refresh call

review: Needs Fixing (continuous-integration)
review: Needs Fixing (continuous-integration)

Unmerged revisions

759. By Dan Chapman  on 2016-02-04

Forward on yearviewdelegate refresh call

758. By Dan Chapman  on 2016-02-04

Adds ScrollView component to view Flickables

It's not possible to add the ScrollView to the PathView where used for
horizontal traversing, like in year view as Path doesn't inherit
Flickable. So another solution will Probably be needed for those areas.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NewEvent.qml'
2--- NewEvent.qml 2016-02-02 22:54:03 +0000
3+++ NewEvent.qml 2016-02-04 10:08:25 +0000
4@@ -344,321 +344,325 @@
5 id:eventUtils
6 }
7
8- Flickable{
9- id: flickable
10- clip: true
11-
12- property var activeItem: null
13-
14- function makeMeVisible(item) {
15- if (!item) {
16- return
17- }
18-
19- activeItem = item
20- var position = flickable.contentItem.mapFromItem(item, 0, 0);
21-
22- // check if the item is already visible
23- var bottomY = flickable.contentY + flickable.height
24- var itemBottom = position.y + item.height
25- if (position.y >= flickable.contentY && itemBottom <= bottomY) {
26- return;
27- }
28-
29- // if it is not, try to scroll and make it visible
30- var targetY = position.y + item.height - flickable.height
31- if (targetY >= 0 && position.y) {
32- flickable.contentY = targetY;
33- } else if (position.y < flickable.contentY) {
34- // if it is hidden at the top, also show it
35- flickable.contentY = position.y;
36- }
37- flickable.returnToBounds()
38- }
39-
40+ ScrollView {
41 anchors.fill: parent
42- contentWidth: width
43- contentHeight: column.height + units.gu(10)
44-
45- Column {
46- id: column
47-
48- width: parent.width
49-
50- NewEventTimePicker{
51- id: startDateTimeInput
52- header: i18n.tr("From")
53- showTimePicker: !allDayEventCheckbox.checked
54- anchors {
55- left: parent.left
56- right: parent.right
57- }
58- onDateTimeChanged: {
59- startDate = dateTime;
60- }
61- }
62-
63- NewEventTimePicker{
64- id: endDateTimeInput
65- header: i18n.tr("To")
66- showTimePicker: !allDayEventCheckbox.checked
67- anchors {
68- left: parent.left
69- right: parent.right
70- }
71- onDateTimeChanged: {
72- endDate = dateTime;
73- }
74- }
75-
76- ListItem.Standard {
77- anchors {
78- left: parent.left
79- right: parent.right
80- }
81-
82- text: i18n.tr("All day event")
83- showDivider: false
84- control: CheckBox {
85- objectName: "allDayEventCheckbox"
86- id: allDayEventCheckbox
87- checked: false
88- }
89- }
90-
91- ListItem.ThinDivider {}
92-
93- Column {
94- width: parent.width
95- spacing: units.gu(1)
96-
97- ListItem.Header{
98- text: i18n.tr("Event Details")
99- }
100-
101- TextField {
102- id: titleEdit
103- objectName: "newEventName"
104-
105- anchors {
106- left: parent.left
107- right: parent.right
108- margins: units.gu(2)
109- }
110-
111- placeholderText: i18n.tr("Event Name")
112- onFocusChanged: {
113- if(titleEdit.focus) {
114- flickable.makeMeVisible(titleEdit);
115- }
116- }
117- }
118-
119- TextArea{
120- id: messageEdit
121- objectName: "eventDescriptionInput"
122-
123- anchors {
124- left: parent.left
125- right: parent.right
126- margins: units.gu(2)
127- }
128-
129- placeholderText: i18n.tr("Description")
130- onFocusChanged: {
131- if(messageEdit.focus) {
132- flickable.makeMeVisible(messageEdit);
133- }
134- }
135- }
136-
137- TextField {
138- id: locationEdit
139- objectName: "eventLocationInput"
140-
141- anchors {
142- left: parent.left
143- right: parent.right
144- margins: units.gu(2)
145- }
146-
147- placeholderText: i18n.tr("Location")
148-
149- onFocusChanged: {
150- if(locationEdit.focus) {
151- flickable.makeMeVisible(locationEdit);
152- }
153- }
154- }
155- }
156-
157- Column {
158- width: parent.width
159- spacing: units.gu(1)
160-
161- ListItem.Header {
162- text: i18n.tr("Calendar")
163- }
164-
165- OptionSelector{
166- id: calendarsOption
167- objectName: "calendarsOption"
168-
169- anchors {
170- left: parent.left
171- right: parent.right
172- margins: units.gu(2)
173- }
174-
175- containerHeight: itemHeight * 4
176- model: root.model.getWritableCollections();
177-
178- delegate: OptionSelectorDelegate{
179- text: modelData.name
180-
181- UbuntuShape{
182- id: calColor
183- width: height
184- height: parent.height - units.gu(2)
185- color: modelData.color
186- anchors.right: parent.right
187- anchors.rightMargin: units.gu(2)
188- anchors.verticalCenter: parent.verticalCenter
189- }
190- }
191- onExpandedChanged: Qt.inputMethod.hide();
192- }
193- }
194-
195- Column {
196- width: parent.width
197- spacing: units.gu(1)
198-
199- ListItem.Header {
200- text: i18n.tr("Guests")
201- }
202-
203- Button{
204- text: i18n.tr("Add Guest")
205- objectName: "addGuestButton"
206-
207- anchors {
208- left: parent.left
209- right: parent.right
210- margins: units.gu(2)
211- }
212-
213- onClicked: {
214- var popup = PopupUtils.open(Qt.resolvedUrl("ContactChoicePopup.qml"), contactList);
215- popup.contactSelected.connect( function(contact) {
216- var t = internal.contactToAttendee(contact);
217- if( !internal.isContactAlreadyAdded(contact) ) {
218- contactModel.append(t);
219- contactList.array.push(t);
220- }
221- });
222- }
223- }
224-
225- UbuntuShape {
226- anchors {
227- left: parent.left
228- right: parent.right
229- margins: units.gu(2)
230- }
231-
232- height: contactList.height
233-
234- Column{
235- id: contactList
236- objectName: "guestList"
237-
238- spacing: units.gu(1)
239- width: parent.width
240- clip: true
241-
242- property var array: []
243-
244- ListModel{
245- id: contactModel
246- }
247-
248- Repeater{
249- model: contactModel
250- delegate: ListItem.Standard {
251- objectName: "eventGuest%1".arg(index)
252- height: units.gu(4)
253- text: name
254- removable: true
255- onItemRemoved: {
256- contactList.array.splice(index, 1)
257- contactModel.remove(index)
258- }
259- }
260- }
261- }
262+
263+ Flickable{
264+ id: flickable
265+ clip: true
266+
267+ property var activeItem: null
268+
269+ function makeMeVisible(item) {
270+ if (!item) {
271+ return
272+ }
273+
274+ activeItem = item
275+ var position = flickable.contentItem.mapFromItem(item, 0, 0);
276+
277+ // check if the item is already visible
278+ var bottomY = flickable.contentY + flickable.height
279+ var itemBottom = position.y + item.height
280+ if (position.y >= flickable.contentY && itemBottom <= bottomY) {
281+ return;
282+ }
283+
284+ // if it is not, try to scroll and make it visible
285+ var targetY = position.y + item.height - flickable.height
286+ if (targetY >= 0 && position.y) {
287+ flickable.contentY = targetY;
288+ } else if (position.y < flickable.contentY) {
289+ // if it is hidden at the top, also show it
290+ flickable.contentY = position.y;
291+ }
292+ flickable.returnToBounds()
293+ }
294+
295+ anchors.fill: parent
296+ contentWidth: width
297+ contentHeight: column.height + units.gu(10)
298+
299+ Column {
300+ id: column
301+
302+ width: parent.width
303+
304+ NewEventTimePicker{
305+ id: startDateTimeInput
306+ header: i18n.tr("From")
307+ showTimePicker: !allDayEventCheckbox.checked
308+ anchors {
309+ left: parent.left
310+ right: parent.right
311+ }
312+ onDateTimeChanged: {
313+ startDate = dateTime;
314+ }
315+ }
316+
317+ NewEventTimePicker{
318+ id: endDateTimeInput
319+ header: i18n.tr("To")
320+ showTimePicker: !allDayEventCheckbox.checked
321+ anchors {
322+ left: parent.left
323+ right: parent.right
324+ }
325+ onDateTimeChanged: {
326+ endDate = dateTime;
327+ }
328+ }
329+
330+ ListItem.Standard {
331+ anchors {
332+ left: parent.left
333+ right: parent.right
334+ }
335+
336+ text: i18n.tr("All day event")
337+ showDivider: false
338+ control: CheckBox {
339+ objectName: "allDayEventCheckbox"
340+ id: allDayEventCheckbox
341+ checked: false
342+ }
343+ }
344+
345+ ListItem.ThinDivider {}
346+
347+ Column {
348+ width: parent.width
349+ spacing: units.gu(1)
350+
351+ ListItem.Header{
352+ text: i18n.tr("Event Details")
353+ }
354+
355+ TextField {
356+ id: titleEdit
357+ objectName: "newEventName"
358+
359+ anchors {
360+ left: parent.left
361+ right: parent.right
362+ margins: units.gu(2)
363+ }
364+
365+ placeholderText: i18n.tr("Event Name")
366+ onFocusChanged: {
367+ if(titleEdit.focus) {
368+ flickable.makeMeVisible(titleEdit);
369+ }
370+ }
371+ }
372+
373+ TextArea{
374+ id: messageEdit
375+ objectName: "eventDescriptionInput"
376+
377+ anchors {
378+ left: parent.left
379+ right: parent.right
380+ margins: units.gu(2)
381+ }
382+
383+ placeholderText: i18n.tr("Description")
384+ onFocusChanged: {
385+ if(messageEdit.focus) {
386+ flickable.makeMeVisible(messageEdit);
387+ }
388+ }
389+ }
390+
391+ TextField {
392+ id: locationEdit
393+ objectName: "eventLocationInput"
394+
395+ anchors {
396+ left: parent.left
397+ right: parent.right
398+ margins: units.gu(2)
399+ }
400+
401+ placeholderText: i18n.tr("Location")
402+
403+ onFocusChanged: {
404+ if(locationEdit.focus) {
405+ flickable.makeMeVisible(locationEdit);
406+ }
407+ }
408+ }
409+ }
410+
411+ Column {
412+ width: parent.width
413+ spacing: units.gu(1)
414+
415+ ListItem.Header {
416+ text: i18n.tr("Calendar")
417+ }
418+
419+ OptionSelector{
420+ id: calendarsOption
421+ objectName: "calendarsOption"
422+
423+ anchors {
424+ left: parent.left
425+ right: parent.right
426+ margins: units.gu(2)
427+ }
428+
429+ containerHeight: itemHeight * 4
430+ model: root.model.getWritableCollections();
431+
432+ delegate: OptionSelectorDelegate{
433+ text: modelData.name
434+
435+ UbuntuShape{
436+ id: calColor
437+ width: height
438+ height: parent.height - units.gu(2)
439+ color: modelData.color
440+ anchors.right: parent.right
441+ anchors.rightMargin: units.gu(2)
442+ anchors.verticalCenter: parent.verticalCenter
443+ }
444+ }
445+ onExpandedChanged: Qt.inputMethod.hide();
446+ }
447+ }
448+
449+ Column {
450+ width: parent.width
451+ spacing: units.gu(1)
452+
453+ ListItem.Header {
454+ text: i18n.tr("Guests")
455+ }
456+
457+ Button{
458+ text: i18n.tr("Add Guest")
459+ objectName: "addGuestButton"
460+
461+ anchors {
462+ left: parent.left
463+ right: parent.right
464+ margins: units.gu(2)
465+ }
466+
467+ onClicked: {
468+ var popup = PopupUtils.open(Qt.resolvedUrl("ContactChoicePopup.qml"), contactList);
469+ popup.contactSelected.connect( function(contact) {
470+ var t = internal.contactToAttendee(contact);
471+ if( !internal.isContactAlreadyAdded(contact) ) {
472+ contactModel.append(t);
473+ contactList.array.push(t);
474+ }
475+ });
476+ }
477+ }
478+
479+ UbuntuShape {
480+ anchors {
481+ left: parent.left
482+ right: parent.right
483+ margins: units.gu(2)
484+ }
485+
486+ height: contactList.height
487+
488+ Column{
489+ id: contactList
490+ objectName: "guestList"
491+
492+ spacing: units.gu(1)
493+ width: parent.width
494+ clip: true
495+
496+ property var array: []
497+
498+ ListModel{
499+ id: contactModel
500+ }
501+
502+ Repeater{
503+ model: contactModel
504+ delegate: ListItem.Standard {
505+ objectName: "eventGuest%1".arg(index)
506+ height: units.gu(4)
507+ text: name
508+ removable: true
509+ onItemRemoved: {
510+ contactList.array.splice(index, 1)
511+ contactModel.remove(index)
512+ }
513+ }
514+ }
515+ }
516+ }
517+
518+ ListItem.ThinDivider {
519+ visible: event.itemType === Type.Event
520+ }
521+
522+ }
523+
524+ ListItem.Subtitled{
525+ id:thisHappens
526+ objectName :"thisHappens"
527+
528+ anchors {
529+ left: parent.left
530+ }
531+
532+ showDivider: false
533+ progression: true
534+ visible: event.itemType === Type.Event
535+ text: i18n.tr("Repeats")
536+ subText: event.itemType === Type.Event ? rule === null ? Defines.recurrenceLabel[0] : eventUtils.getRecurrenceString(rule) : ""
537+ onClicked: pageStack.push(Qt.resolvedUrl("EventRepetition.qml"),{"eventRoot": root,"isEdit":isEdit});
538 }
539
540 ListItem.ThinDivider {
541 visible: event.itemType === Type.Event
542 }
543
544- }
545-
546- ListItem.Subtitled{
547- id:thisHappens
548- objectName :"thisHappens"
549-
550- anchors {
551- left: parent.left
552- }
553-
554- showDivider: false
555- progression: true
556- visible: event.itemType === Type.Event
557- text: i18n.tr("Repeats")
558- subText: event.itemType === Type.Event ? rule === null ? Defines.recurrenceLabel[0] : eventUtils.getRecurrenceString(rule) : ""
559- onClicked: pageStack.push(Qt.resolvedUrl("EventRepetition.qml"),{"eventRoot": root,"isEdit":isEdit});
560- }
561-
562- ListItem.ThinDivider {
563- visible: event.itemType === Type.Event
564- }
565-
566- ListItem.Subtitled{
567- id:eventReminder
568- objectName : "eventReminder"
569-
570- anchors.left:parent.left
571- showDivider: false
572- progression: true
573- text: i18n.tr("Reminder")
574-
575- RemindersModel {
576- id: reminderModel
577- }
578-
579- subText:{
580- if(visualReminder.secondsBeforeStart !== -1) {
581- for( var i=0; i<reminderModel.count; i++ ) {
582- if(visualReminder.secondsBeforeStart === reminderModel.get(i).value) {
583- return reminderModel.get(i).label
584+ ListItem.Subtitled{
585+ id:eventReminder
586+ objectName : "eventReminder"
587+
588+ anchors.left:parent.left
589+ showDivider: false
590+ progression: true
591+ text: i18n.tr("Reminder")
592+
593+ RemindersModel {
594+ id: reminderModel
595+ }
596+
597+ subText:{
598+ if(visualReminder.secondsBeforeStart !== -1) {
599+ for( var i=0; i<reminderModel.count; i++ ) {
600+ if(visualReminder.secondsBeforeStart === reminderModel.get(i).value) {
601+ return reminderModel.get(i).label
602+ }
603 }
604+ } else {
605+ return reminderModel.get(0).label
606 }
607- } else {
608- return reminderModel.get(0).label
609+
610 }
611
612+ onClicked: pageStack.push(Qt.resolvedUrl("EventReminder.qml"),
613+ {"visualReminder": visualReminder,
614+ "audibleReminder": audibleReminder,
615+ "reminderModel": reminderModel,
616+ "eventTitle": titleEdit.text})
617 }
618
619- onClicked: pageStack.push(Qt.resolvedUrl("EventReminder.qml"),
620- {"visualReminder": visualReminder,
621- "audibleReminder": audibleReminder,
622- "reminderModel": reminderModel,
623- "eventTitle": titleEdit.text})
624+ ListItem.ThinDivider {}
625 }
626-
627- ListItem.ThinDivider {}
628 }
629 }
630 // used to keep the field visible when the keyboard appear or dismiss
631
632=== modified file 'TimeLineBaseComponent.qml'
633--- TimeLineBaseComponent.qml 2016-01-29 14:35:14 +0000
634+++ TimeLineBaseComponent.qml 2016-02-04 10:08:25 +0000
635@@ -111,11 +111,11 @@
636 }
637
638 Timer{
639- interval: 200; running: true; repeat: false
640- onTriggered: {
641- mainModel = modelComponent.createObject();
642- activityLoader.running = Qt.binding( function (){ return mainModel.isLoading;});
643- }
644+ interval: 200; running: true; repeat: false
645+ onTriggered: {
646+ mainModel = modelComponent.createObject();
647+ activityLoader.running = Qt.binding( function (){ return mainModel.isLoading;});
648+ }
649 }
650
651 Component {
652@@ -171,139 +171,140 @@
653 width: units.gu(0.1)
654 height: parent.height
655 }
656-
657- Flickable {
658- id: timeLineView
659- objectName: "timelineview"
660-
661+ ScrollView {
662 height: parent.height
663 width: parent.width - units.gu(6)
664
665- boundsBehavior: Flickable.StopAtBounds
666-
667- property int delegateWidth: {
668- if( type == ViewType.ViewTypeWeek ) {
669- width/3 - units.gu(1) /*partial visible area*/
670- } else {
671- width
672- }
673- }
674-
675- contentHeight: units.gu(8) * 24
676- contentWidth: {
677- if( type == ViewType.ViewTypeWeek ) {
678- delegateWidth*7
679- } else {
680- width
681- }
682- }
683-
684- onContentWidthChanged: {
685- scrollToCurrentTime();
686- scrollTocurrentDate();
687- }
688-
689- clip: true
690-
691- TimeLineBackground{}
692-
693- Row {
694- id: week
695+ Flickable {
696+ id: timeLineView
697+ objectName: "timelineview"
698 anchors.fill: parent
699- Repeater {
700- model: type == ViewType.ViewTypeWeek ? 7 : 1
701-
702- delegate: TimeLineBase {
703- property int idx: index
704- anchors.top: parent.top
705- width: {
706- if( type == ViewType.ViewTypeWeek ) {
707- parent.width / 7
708- } else {
709- (parent.width)
710- }
711- }
712- height: parent.height
713- delegate: comp
714- day: startDay.addDays(index)
715- model: mainModel
716-
717- Connections{
718- target: mainModel
719-
720- onModelChanged: {
721- createEvents();
722- }
723- }
724-
725- DropArea {
726- id: dropArea
727- objectName: "mouseArea"
728- anchors.fill: parent
729-
730- function modifyEventForDrag(drag) {
731- var event = drag.source.event;
732- var diff = event.endDateTime.getTime() - event.startDateTime.getTime();
733-
734- var startDate = getTimeFromYPos(drag.y, day);
735- var endDate = new Date( startDate.getTime() + diff );
736-
737- event.startDateTime = startDate;
738- event.endDateTime = endDate;
739-
740- return event;
741- }
742-
743- onDropped: {
744- var event = dropArea.modifyEventForDrag(drop);
745- model.saveItem(event);
746- }
747-
748- onPositionChanged: {
749- dropArea.modifyEventForDrag(drag)
750- var eventBubble = drag.source;
751- eventBubble.assingnBgColor();
752- eventBubble.setDetails();
753-
754- if( eventBubble.y + eventBubble.height + units.gu(8) > timeLineView.contentY + timeLineView.height ) {
755- var diff = Math.abs((eventBubble.y + eventBubble.height + units.gu(8)) -
756- (timeLineView.height + timeLineView.contentY));
757- timeLineView.contentY += diff
758-
759- if(timeLineView.contentY >= timeLineView.contentHeight - timeLineView.height) {
760- timeLineView.contentY = timeLineView.contentHeight - timeLineView.height
761- }
762- }
763-
764- if(eventBubble.y - units.gu(8) < timeLineView.contentY ) {
765- var diff = Math.abs((eventBubble.y - units.gu(8)) - timeLineView.contentY);
766- timeLineView.contentY -= diff
767-
768- if(timeLineView.contentY <= 0) {
769- timeLineView.contentY = 0;
770- }
771- }
772- }
773- }
774-
775- Loader{
776- objectName: "weekdevider"
777+ boundsBehavior: Flickable.StopAtBounds
778+
779+ property int delegateWidth: {
780+ if( type == ViewType.ViewTypeWeek ) {
781+ width/3 - units.gu(1) /*partial visible area*/
782+ } else {
783+ width
784+ }
785+ }
786+
787+ contentHeight: units.gu(8) * 24
788+ contentWidth: {
789+ if( type == ViewType.ViewTypeWeek ) {
790+ delegateWidth*7
791+ } else {
792+ width
793+ }
794+ }
795+
796+ onContentWidthChanged: {
797+ scrollToCurrentTime();
798+ scrollTocurrentDate();
799+ }
800+
801+ clip: true
802+
803+ TimeLineBackground{}
804+
805+ Row {
806+ id: week
807+ anchors.fill: parent
808+ Repeater {
809+ model: type == ViewType.ViewTypeWeek ? 7 : 1
810+
811+ delegate: TimeLineBase {
812+ property int idx: index
813+ anchors.top: parent.top
814+ width: {
815+ if( type == ViewType.ViewTypeWeek ) {
816+ parent.width / 7
817+ } else {
818+ (parent.width)
819+ }
820+ }
821 height: parent.height
822- width: units.gu(0.15)
823- sourceComponent: type == ViewType.ViewTypeWeek ? weekDividerComponent : undefined
824- }
825-
826- Component {
827- id: weekDividerComponent
828- SimpleDivider{
829+ delegate: comp
830+ day: startDay.addDays(index)
831+ model: mainModel
832+
833+ Connections{
834+ target: mainModel
835+
836+ onModelChanged: {
837+ createEvents();
838+ }
839+ }
840+
841+ DropArea {
842+ id: dropArea
843+ objectName: "mouseArea"
844 anchors.fill: parent
845- }
846- }
847-
848- Connections{
849- target: mainModel
850- onStartPeriodChanged:{
851- destroyAllChildren();
852+
853+ function modifyEventForDrag(drag) {
854+ var event = drag.source.event;
855+ var diff = event.endDateTime.getTime() - event.startDateTime.getTime();
856+
857+ var startDate = getTimeFromYPos(drag.y, day);
858+ var endDate = new Date( startDate.getTime() + diff );
859+
860+ event.startDateTime = startDate;
861+ event.endDateTime = endDate;
862+
863+ return event;
864+ }
865+
866+ onDropped: {
867+ var event = dropArea.modifyEventForDrag(drop);
868+ model.saveItem(event);
869+ }
870+
871+ onPositionChanged: {
872+ dropArea.modifyEventForDrag(drag)
873+ var eventBubble = drag.source;
874+ eventBubble.assingnBgColor();
875+ eventBubble.setDetails();
876+
877+ if( eventBubble.y + eventBubble.height + units.gu(8) > timeLineView.contentY + timeLineView.height ) {
878+ var diff = Math.abs((eventBubble.y + eventBubble.height + units.gu(8)) -
879+ (timeLineView.height + timeLineView.contentY));
880+ timeLineView.contentY += diff
881+
882+ if(timeLineView.contentY >= timeLineView.contentHeight - timeLineView.height) {
883+ timeLineView.contentY = timeLineView.contentHeight - timeLineView.height
884+ }
885+ }
886+
887+ if(eventBubble.y - units.gu(8) < timeLineView.contentY ) {
888+ var diff = Math.abs((eventBubble.y - units.gu(8)) - timeLineView.contentY);
889+ timeLineView.contentY -= diff
890+
891+ if(timeLineView.contentY <= 0) {
892+ timeLineView.contentY = 0;
893+ }
894+ }
895+ }
896+ }
897+
898+ Loader{
899+ objectName: "weekdevider"
900+ height: parent.height
901+ width: units.gu(0.15)
902+ sourceComponent: type == ViewType.ViewTypeWeek ? weekDividerComponent : undefined
903+ }
904+
905+ Component {
906+ id: weekDividerComponent
907+ SimpleDivider{
908+ anchors.fill: parent
909+ }
910+ }
911+
912+ Connections{
913+ target: mainModel
914+ onStartPeriodChanged:{
915+ destroyAllChildren();
916+ }
917 }
918 }
919 }
920
921=== modified file 'YearView.qml'
922--- YearView.qml 2016-02-03 08:06:25 +0000
923+++ YearView.qml 2016-02-04 10:08:25 +0000
924@@ -89,15 +89,27 @@
925
926 Component{
927 id: delegateComponent
928-
929- YearViewDelegate{
930- focus: index == yearPathView.currentIndex
931-
932- scrollMonth: 0;
933- isCurrentItem: index == yearPathView.currentIndex
934- year: (currentYear + yearPathView.indexType(index))
935-
936+ ScrollView {
937+ id: scrollView
938 anchors.fill: parent
939+ // This is just forwarding the function call on to the delegate
940+ signal refresh()
941+
942+ YearViewDelegate{
943+ id: yrView
944+ focus: index == yearPathView.currentIndex
945+
946+ scrollMonth: 0;
947+ isCurrentItem: index == yearPathView.currentIndex
948+ year: (currentYear + yearPathView.indexType(index))
949+
950+ anchors.fill: parent
951+
952+ Connections {
953+ target: scrollView
954+ onRefresh: yrView.refresh()
955+ }
956+ }
957 }
958 }
959 }
960
961=== modified file 'po/com.ubuntu.calendar.pot'
962--- po/com.ubuntu.calendar.pot 2016-02-03 14:55:42 +0000
963+++ po/com.ubuntu.calendar.pot 2016-02-04 10:08:25 +0000
964@@ -1,6 +1,6 @@
965 # SOME DESCRIPTIVE TITLE.
966 # Copyright (C) YEAR Canonical Ltd.
967-# This file is distributed under the same license as the PACKAGE package.
968+# This file is distributed under the same license as the package.
969 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
970 #
971 #, fuzzy
972@@ -8,7 +8,7 @@
973 msgstr ""
974 "Project-Id-Version: \n"
975 "Report-Msgid-Bugs-To: \n"
976-"POT-Creation-Date: 2016-01-11 21:36+0800\n"
977+"POT-Creation-Date: 2016-02-04 10:03+0000\n"
978 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
979 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
980 "Language-Team: LANGUAGE <LL@li.org>\n"
981@@ -18,30 +18,39 @@
982 "Content-Transfer-Encoding: 8bit\n"
983 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
984
985-#: ../AgendaView.qml:51 ../DayView.qml:40 ../MonthView.qml:39
986-#: ../WeekView.qml:44 ../YearView.qml:36
987+#: ../AgendaView.qml:52 ../DayView.qml:41 ../MonthView.qml:40
988+#: ../WeekView.qml:45 ../YearView.qml:43
989 msgid "Today"
990 msgstr ""
991
992-#: ../AgendaView.qml:92
993+#: ../AgendaView.qml:62 ../calendar.qml:291 ../calendar.qml:512
994+msgid "Agenda"
995+msgstr ""
996+
997+#: ../AgendaView.qml:101
998 msgid "No upcoming events"
999 msgstr ""
1000
1001-#: ../AgendaView.qml:95
1002+#: ../AgendaView.qml:104
1003 msgid "You have no calendars enabled"
1004 msgstr ""
1005
1006-#: ../AgendaView.qml:105
1007+#: ../AgendaView.qml:114
1008 msgid "Enable calendars"
1009 msgstr ""
1010
1011 #. TRANSLATORS: the first argument (%1) refers to a start time for an event,
1012 #. while the second one (%2) refers to the end time
1013-#: ../AgendaView.qml:168 ../EventBubble.qml:133
1014+#: ../AgendaView.qml:177 ../EventBubble.qml:133
1015 #, qt-format
1016 msgid "%1 - %2"
1017 msgstr ""
1018
1019+#: ../AgendaView.qml:183
1020+#, qt-format
1021+msgid "%1 %2 %3 %4 %5"
1022+msgstr ""
1023+
1024 #. TRANSLATORS: the first parameter refers to the number of all-day events
1025 #. on a given day. "Ev." is short form for "Events".
1026 #. Please keep the translation of "Ev." to 3 characters only, as the week view
1027@@ -59,21 +68,21 @@
1028 msgstr[0] ""
1029 msgstr[1] ""
1030
1031-#: ../CalendarChoicePopup.qml:33 ../EventActions.qml:60
1032+#: ../CalendarChoicePopup.qml:33 ../EventActions.qml:63
1033 msgid "Calendars"
1034 msgstr ""
1035
1036-#: ../CalendarChoicePopup.qml:37
1037+#: ../CalendarChoicePopup.qml:37 ../Settings.qml:32
1038 msgid "Back"
1039 msgstr ""
1040
1041 #. TRANSLATORS: Please translate this string to 15 characters only.
1042 #. Currently ,there is no way we can increase width of action menu currently.
1043-#: ../CalendarChoicePopup.qml:51 ../EventActions.qml:36
1044+#: ../CalendarChoicePopup.qml:51 ../EventActions.qml:37
1045 msgid "Sync"
1046 msgstr ""
1047
1048-#: ../CalendarChoicePopup.qml:51 ../EventActions.qml:36
1049+#: ../CalendarChoicePopup.qml:51 ../EventActions.qml:37
1050 msgid "Syncing"
1051 msgstr ""
1052
1053@@ -101,10 +110,16 @@
1054 #. TRANSLATORS: this is a time formatting string,
1055 #. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
1056 #. It's used in the header of the month and week views
1057-#: ../DayView.qml:59 ../MonthView.qml:60 ../WeekView.qml:63
1058+#: ../DayView.qml:64 ../DayView.qml:157 ../MonthView.qml:62
1059+#: ../MonthView.qml:149 ../WeekView.qml:68 ../WeekView.qml:180
1060 msgid "MMMM yyyy"
1061 msgstr ""
1062
1063+#: ../DayView.qml:155 ../MonthView.qml:144 ../WeekView.qml:178
1064+#, qt-format
1065+msgid "%1 %2"
1066+msgstr ""
1067+
1068 #: ../DeleteConfirmationDialog.qml:31
1069 msgid "Delete Recurring Event"
1070 msgstr ""
1071@@ -136,7 +151,7 @@
1072 msgid "Delete"
1073 msgstr ""
1074
1075-#: ../EditEventConfirmationDialog.qml:29 ../NewEvent.qml:324
1076+#: ../EditEventConfirmationDialog.qml:29 ../NewEvent.qml:325
1077 msgid "Edit Event"
1078 msgstr ""
1079
1080@@ -154,10 +169,14 @@
1081 msgid "Edit this"
1082 msgstr ""
1083
1084-#: ../EventActions.qml:50 ../NewEvent.qml:324
1085+#: ../EventActions.qml:52 ../NewEvent.qml:325
1086 msgid "New Event"
1087 msgstr ""
1088
1089+#: ../EventActions.qml:75 ../Settings.qml:30
1090+msgid "Settings"
1091+msgstr ""
1092+
1093 #. TRANSLATORS: the first argument (%1) refers to a time for an event,
1094 #. while the second one (%2) refers to title of event
1095 #: ../EventBubble.qml:144 ../EventBubble.qml:149
1096@@ -165,35 +184,55 @@
1097 msgid "%1 <b>%2</b>"
1098 msgstr ""
1099
1100-#: ../EventDetails.qml:43 ../NewEvent.qml:435
1101+#: ../EventDetails.qml:44 ../NewEvent.qml:439
1102 msgid "Event Details"
1103 msgstr ""
1104
1105 #. TRANSLATORS: the first parameter refers to the name of event calendar.
1106-#: ../EventDetails.qml:68
1107+#: ../EventDetails.qml:69
1108 #, qt-format
1109 msgid "%1 Calendar"
1110 msgstr ""
1111
1112-#: ../EventDetails.qml:129
1113+#: ../EventDetails.qml:143
1114+#, qt-format
1115+msgid "%1 %2 %3 - %4 %5 %6 (All Day)"
1116+msgstr ""
1117+
1118+#: ../EventDetails.qml:147
1119 #, qt-format
1120 msgid "%1 - %2 (All Day)"
1121 msgstr ""
1122
1123-#: ../EventDetails.qml:133
1124+#: ../EventDetails.qml:153
1125+#, qt-format
1126+msgid "%1 %2 %3 (All Day)"
1127+msgstr ""
1128+
1129+#: ../EventDetails.qml:156
1130 #, qt-format
1131 msgid "%1 (All Day)"
1132 msgstr ""
1133
1134-#: ../EventDetails.qml:203
1135+#: ../EventDetails.qml:162
1136+#, qt-format
1137+msgid "%1 %2 %3, %4 - %5 %6 %7, %8"
1138+msgstr ""
1139+
1140+#: ../EventDetails.qml:171
1141+#, qt-format
1142+msgid "%1 %2 %3, %4 - %5"
1143+msgstr ""
1144+
1145+#: ../EventDetails.qml:238
1146 msgid "Edit"
1147 msgstr ""
1148
1149-#: ../EventDetails.qml:354 ../NewEvent.qml:537
1150+#: ../EventDetails.qml:389 ../NewEvent.qml:541
1151 msgid "Guests"
1152 msgstr ""
1153
1154-#: ../EventDetails.qml:397 ../EventReminder.qml:35 ../NewEvent.qml:634
1155+#: ../EventDetails.qml:432 ../EventReminder.qml:35 ../NewEvent.qml:638
1156 msgid "Reminder"
1157 msgstr ""
1158
1159@@ -216,7 +255,7 @@
1160 #. TRANSLATORS: this refers to how often a recurrent event repeats
1161 #. and it is shown as the header of the option selector to choose
1162 #. its repetition
1163-#: ../EventRepetition.qml:242 ../NewEvent.qml:618
1164+#: ../EventRepetition.qml:242 ../NewEvent.qml:622
1165 msgid "Repeats"
1166 msgstr ""
1167
1168@@ -247,6 +286,11 @@
1169 msgid "Weekly on %1"
1170 msgstr ""
1171
1172+#: ../HeaderDateComponent.qml:90
1173+#, qt-format
1174+msgid "%1 %2 %3"
1175+msgstr ""
1176+
1177 #: ../LimitLabelModel.qml:25
1178 msgid "Never"
1179 msgstr ""
1180@@ -259,6 +303,10 @@
1181 msgid "After Date"
1182 msgstr ""
1183
1184+#: ../MonthComponent.qml:262
1185+msgid "Wk"
1186+msgstr ""
1187+
1188 #: ../NewEvent.qml:84
1189 msgid "Save"
1190 msgstr ""
1191@@ -267,43 +315,43 @@
1192 msgid "End time can't be before start time"
1193 msgstr ""
1194
1195-#: ../NewEvent.qml:334
1196+#: ../NewEvent.qml:335
1197 msgid "Error"
1198 msgstr ""
1199
1200-#: ../NewEvent.qml:336
1201+#: ../NewEvent.qml:337
1202 msgid "OK"
1203 msgstr ""
1204
1205-#: ../NewEvent.qml:389
1206+#: ../NewEvent.qml:393
1207 msgid "From"
1208 msgstr ""
1209
1210-#: ../NewEvent.qml:402
1211+#: ../NewEvent.qml:406
1212 msgid "To"
1213 msgstr ""
1214
1215-#: ../NewEvent.qml:419
1216+#: ../NewEvent.qml:423
1217 msgid "All day event"
1218 msgstr ""
1219
1220-#: ../NewEvent.qml:448
1221+#: ../NewEvent.qml:452
1222 msgid "Event Name"
1223 msgstr ""
1224
1225-#: ../NewEvent.qml:466
1226+#: ../NewEvent.qml:470
1227 msgid "Description"
1228 msgstr ""
1229
1230-#: ../NewEvent.qml:484
1231+#: ../NewEvent.qml:488
1232 msgid "Location"
1233 msgstr ""
1234
1235-#: ../NewEvent.qml:499 com.ubuntu.calendar_calendar.desktop.in.in.h:1
1236+#: ../NewEvent.qml:503 com.ubuntu.calendar_calendar.desktop.in.in.h:1
1237 msgid "Calendar"
1238 msgstr ""
1239
1240-#: ../NewEvent.qml:541
1241+#: ../NewEvent.qml:545
1242 msgid "Add Guest"
1243 msgstr ""
1244
1245@@ -390,52 +438,56 @@
1246 msgid "2 weeks"
1247 msgstr ""
1248
1249+#: ../Settings.qml:60
1250+msgid "Show week numbers"
1251+msgstr ""
1252+
1253+#: ../Settings.qml:91
1254+msgid "Show lunar calendar"
1255+msgstr ""
1256+
1257 #: ../TimeLineBase.qml:73
1258 msgid "Untitled"
1259 msgstr ""
1260
1261 #. TRANSLATORS: W refers to Week, followed by the actual week number (%1)
1262-#: ../TimeLineHeader.qml:54
1263+#: ../TimeLineHeader.qml:53
1264 #, qt-format
1265 msgid "W%1"
1266 msgstr ""
1267
1268-#: ../TimeLineHeader.qml:66
1269+#: ../TimeLineHeader.qml:65
1270 msgid "All Day"
1271 msgstr ""
1272
1273-#: ../YearView.qml:54
1274+#: ../YearView.qml:61 ../YearView.qml:124
1275 #, qt-format
1276 msgid "Year %1"
1277 msgstr ""
1278
1279-#: ../calendar.qml:45
1280+#: ../calendar.qml:46
1281 msgid ""
1282 "Calendar app accept four arguments: --starttime, --endtime, --newevent and --"
1283 "eventid. They will be managed by system. See the source for a full comment "
1284 "about them"
1285 msgstr ""
1286
1287-#: ../calendar.qml:354
1288+#: ../calendar.qml:259 ../calendar.qml:428
1289 msgid "Year"
1290 msgstr ""
1291
1292-#: ../calendar.qml:388
1293+#: ../calendar.qml:267 ../calendar.qml:449
1294 msgid "Month"
1295 msgstr ""
1296
1297-#: ../calendar.qml:421
1298+#: ../calendar.qml:275 ../calendar.qml:470
1299 msgid "Week"
1300 msgstr ""
1301
1302-#: ../calendar.qml:459
1303+#: ../calendar.qml:283 ../calendar.qml:491
1304 msgid "Day"
1305 msgstr ""
1306
1307-#: ../calendar.qml:491
1308-msgid "Agenda"
1309-msgstr ""
1310-
1311 #: com.ubuntu.calendar_calendar.desktop.in.in.h:2
1312 msgid "A calendar for Ubuntu which syncs with online accounts."
1313 msgstr ""

Subscribers

People subscribed via source and target branches

to status/vote changes: