Merge lp:~mihirsoni/ubuntu-calendar-app/bottomEdge into lp:ubuntu-calendar-app

Proposed by Mihir Soni
Status: Rejected
Rejected by: Renato Araujo Oliveira Filho
Proposed branch: lp:~mihirsoni/ubuntu-calendar-app/bottomEdge
Merge into: lp:ubuntu-calendar-app
Diff against target: 600 lines (+447/-9)
6 files modified
DayView.qml (+10/-1)
MonthView.qml (+8/-2)
NewEvent.qml (+8/-3)
PageWithBottomEdge.qml (+407/-0)
WeekView.qml (+9/-1)
calendar.qml (+5/-2)
To merge this branch: bzr merge lp:~mihirsoni/ubuntu-calendar-app/bottomEdge
Reviewer Review Type Date Requested Status
Nicholas Skaggs (community) Needs Fixing
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Kunal Parmar Needs Information
Review via email: mp+241590@code.launchpad.net

Commit message

Added Bottom Edge for Month/Week/Day views

Description of the change

Added Bottom Edge :

1.Month View
2.Week View
3.Day View

PageWithBottomEdge.qml component has been taken from address-book application.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
548. By Mihir Soni

Date issue resolved

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 :

Why can't we add bottom edge to MainView( Calendar.qml), that way it will apply bottom edge to all views and also we dont need to create models as well.

review: Needs Information
549. By Mihir Soni

Changed lil logic for loading EventModel

Revision history for this message
Mihir Soni (mihirsoni) wrote :

Hi Kunal,

I did try to put this in MainView before , but it is not behaving properly while it comes to PageStack push.

With respect to your comment , I have changed logic and now I am just passing eventModel once, so we don't create models multiple time.

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 :

> Hi Kunal,
>
> I did try to put this in MainView before , but it is not behaving properly
> while it comes to PageStack push.
>
Can you create separate branch where I can try your code with bottom edge on MainView ?

Revision history for this message
Mihir Soni (mihirsoni) wrote :

Hi Kunal,

I have spoke to Rentu regarding as the Bottomege Page in Mainview as he said it might not be possible and he hasn't tried.

I have tried it in other branch , you can access that with

https://code.launchpad.net/~mihirsoni/+junk/MainViewBottomEdge

I have added code in MainView and only for Month view.

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
Nicholas Skaggs (nskaggs) wrote :
Download full text (3.6 KiB)

So the tests show failure because more than one new event page is found. Only one page is visible, but this still seems a bit weird to me. Note one is inside MonthView, while the other is on the page stack. Full log is here: http://paste.ubuntu.com/9221454/.

First NewEvent Object

== /comubuntucalendar/QQuickView/MainView/OrientationHelper/QQuickItem/QQuickItem/PageStack/PageWrapper/Tabs/QQuickItem/Tab/QQuickLoader/MonthView/QQuickRectangle/QQuickLoader/NewEvent ==
Children: [dbus.String('QQuickLoader_QML_2'), dbus.String('QQmlBind'), dbus.String('QQuickItem_QML_21'), dbus.String('QQmlComponentAttached'), dbus.String('QQuickLoader'), dbus.String('Object_QMLTYPE_3_QML_32'), dbus.String('PageHeadConfiguration_QMLTYPE_5'), dbus.String('Object_QMLTYPE_3_QML_78'), dbus.String('QDeclarativeOrganizerItemVisualReminder'), dbus.String('QDeclarativeOrganizerItemAudibleReminder'), dbus.String('QQuickPropertyAnimation'), dbus.String('QQmlComponent'), dbus.String('EventUtils_QMLTYPE_151'), dbus.String('QQuickFlickable_QML_158'), dbus.String('KeyboardRectangle_QMLTYPE_111'), dbus.String('QObject_QML_160'), dbus.String('QQuickKeysAttached'), dbus.String('QQmlContext'), dbus.String('QQuickLoader_QML_2'), dbus.String('QQuickItem_QML_21'), dbus.String('QQuickLoader'), dbus.String('QQuickFlickable_QML_158'), dbus.String('KeyboardRectangle_QMLTYPE_111')]
__isPageTreeNode: True
_autopilot_id: 13
active: False
activeFocus: False
activeFocusOnPress: True
activeFocusOnTab: False
antialiasing: False
baselineOffset: 0.0
clip: False
date: DateTime(2014-11-24 17:02:42)
enabled: True
endDate: DateTime(2014-11-24 18:02:42)
focus: False
globalRect: Rectangle(1275, 1400, 800, 568)
height: 568.0
id: 13
implicitHeight: 0.0
implicitWidth: 0.0
isEdit: False
isLeaf: True
objectName: 'newEventPage'
opacity: 1.0
rotation: 0.0
scale: 1.0
scrollY: -0.0
smooth: True
startDate: DateTime(2014-11-24 17:02:42)
state: ''
title: 'New Event'
transformOrigin: 4
visible: False
width: 800.0
x: 0.0
y: 0.0
z: 0.0

And the second NewEvent object

== /comubuntucalendar/QQuickView/MainView/OrientationHelper/QQuickItem/QQuickItem/PageStack/PageWrapper/NewEvent ==
Children: [dbus.String('QQuickLoader_QML_2'), dbus.String('QQmlBind'), dbus.String('QQuickItem_QML_21'), dbus.String('QQmlComponentAttached'), dbus.String('QQuickLoader'), dbus.String('Object_QMLTYPE_3_QML_32'), dbus.String('PageHeadConfiguration_QMLTYPE_5'), dbus.String('Object_QMLTYPE_3_QML_78'), dbus.String('QDeclarativeOrganizerItemVisualReminder'), dbus.String('QDeclarativeOrganizerItemAudibleReminder'), dbus.String('QQuickPropertyAnimation'), dbus.String('QQmlComponent'), dbus.String('EventUtils_QMLTYPE_151'), dbus.String('QQuickFlickable_QML_158'), dbus.String('KeyboardRectangle_QMLTYPE_111'), dbus.String('QObject_QML_160'), dbus.String('QQuickKeysAttached'), dbus.String('QQuickLoader_QML_2'), dbus.String('QQuickItem_QML_21'), dbus.String('QQuickLoader'), dbus.String('QQuickFlickable_QML_158'), dbus.String('KeyboardRectangle_QMLTYPE_111')]
__isPageTreeNode: True
_autopilot_id: 14
active: True
activeFocus: False
activeFocusOnPress: True
activeFocusOnTab: False
antialiasing: False
baselineOffset: 0.0
clip: False
date: DateTime(2014-11...

Read more...

review: Needs Fixing
Revision history for this message
Mihir Soni (mihirsoni) wrote :

Hi Nic,

Thanks for updates. Yes we're yet to remove that page from pagestack as we have added NewEvent in bottomedge.
The concern is, as of now we don't have helpers for bottomedge.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Mihir, clock app recently fixed bottom edge support. For the moment, the toolkit doesn't have helpers (Leo mentioned it as not possible as there is no standard implementation). If that's the case, I think you can copy over the helper as written in clock. I believe file manager also recently had a bottom edge test implemented by Carla, so there's 2 examples.

I'd remove the extra page from the pagestack so you can work on the helpers for the bottom edge.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

thanks for the work. Unfortunately a new component has landed on SDK. We are using that for now.

Unmerged revisions

549. By Mihir Soni

Changed lil logic for loading EventModel

548. By Mihir Soni

Date issue resolved

547. By Mihir Soni

Added Bottom Edge for Month/Day/Week views

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'DayView.qml'
--- DayView.qml 2014-11-06 13:57:42 +0000
+++ DayView.qml 2014-11-16 10:11:33 +0000
@@ -21,12 +21,13 @@
21import "dateExt.js" as DateExt21import "dateExt.js" as DateExt
22import "ViewType.js" as ViewType22import "ViewType.js" as ViewType
2323
24Page{24PageWithBottomEdge {
25 id: dayViewPage25 id: dayViewPage
26 objectName: "dayViewPage"26 objectName: "dayViewPage"
2727
28 property var currentDay: new Date()28 property var currentDay: new Date()
29 property bool isCurrentPage: false29 property bool isCurrentPage: false
30 property var eventModel;
3031
31 signal dateSelected(var date);32 signal dateSelected(var date);
3233
@@ -60,6 +61,14 @@
60 }61 }
61 }62 }
6263
64 reloadBottomEdgePage: true
65 bottomEdgeTitle : i18n.tr("New Event")
66 bottomEdgePageComponent : NewEvent {
67 model: eventModel
68 date: currentDay
69 }
70
71
63 Column {72 Column {
64 anchors.fill: parent73 anchors.fill: parent
65 anchors.topMargin: units.gu(1)74 anchors.topMargin: units.gu(1)
6675
=== modified file 'MonthView.qml'
--- MonthView.qml 2014-10-22 18:39:27 +0000
+++ MonthView.qml 2014-11-16 10:11:33 +0000
@@ -20,12 +20,12 @@
20import "dateExt.js" as DateExt20import "dateExt.js" as DateExt
21import "colorUtils.js" as Color21import "colorUtils.js" as Color
2222
23Page {23PageWithBottomEdge {
24 id: monthViewPage24 id: monthViewPage
25 objectName: "monthViewPage"25 objectName: "monthViewPage"
2626
27 property var currentMonth: DateExt.today();27 property var currentMonth: DateExt.today();
2828 property var eventModel;
29 signal dateSelected(var date);29 signal dateSelected(var date);
3030
31 Keys.forwardTo: [monthViewPath]31 Keys.forwardTo: [monthViewPath]
@@ -58,6 +58,12 @@
58 }58 }
59 }59 }
6060
61 bottomEdgeTitle : i18n.tr("New Event")
62 bottomEdgePageComponent : NewEvent{
63 model: eventModel
64 date : new Date()
65 }
66
61 PathViewBase{67 PathViewBase{
62 id: monthViewPath68 id: monthViewPath
63 objectName: "monthViewPath"69 objectName: "monthViewPath"
6470
=== modified file 'NewEvent.qml'
--- NewEvent.qml 2014-11-04 15:08:45 +0000
+++ NewEvent.qml 2014-11-16 10:11:33 +0000
@@ -44,6 +44,11 @@
4444
45 signal eventAdded(var event);45 signal eventAdded(var event);
4646
47 onDateChanged: {
48 startDateTimeInput.dateTime = date;
49 adjustEndDateToStartDate();
50 }
51
47 onStartDateChanged: {52 onStartDateChanged: {
48 startDateTimeInput.dateTime = startDate;53 startDateTimeInput.dateTime = startDate;
49 adjustEndDateToStartDate()54 adjustEndDateToStartDate()
@@ -109,7 +114,7 @@
109 event = Qt.createQmlObject("import QtOrganizer 5.0; Event { }", Qt.application,"NewEvent.qml");114 event = Qt.createQmlObject("import QtOrganizer 5.0; Event { }", Qt.application,"NewEvent.qml");
110 //Create fresh Recurrence Object.115 //Create fresh Recurrence Object.
111 rule = Qt.createQmlObject("import QtOrganizer 5.0; RecurrenceRule {}", event.recurrence,"EventRepetition.qml");116 rule = Qt.createQmlObject("import QtOrganizer 5.0; RecurrenceRule {}", event.recurrence,"EventRepetition.qml");
112 selectCalendar(model.defaultCollection().collectionId); 117 selectCalendar(model.defaultCollection().collectionId);
113 }118 }
114119
115 //Editing Event120 //Editing Event
@@ -277,8 +282,8 @@
277 scrollAnimation.start()282 scrollAnimation.start()
278 }283 }
279284
280 width: parent.width285 width: parent ? parent.width : 0
281 height: parent.height286 height: parent ? parent.height : 0
282287
283 title: isEdit ? i18n.tr("Edit Event"):i18n.tr("New Event")288 title: isEdit ? i18n.tr("Edit Event"):i18n.tr("New Event")
284289
285290
=== added file 'PageWithBottomEdge.qml'
--- PageWithBottomEdge.qml 1970-01-01 00:00:00 +0000
+++ PageWithBottomEdge.qml 2014-11-16 10:11:33 +0000
@@ -0,0 +1,407 @@
1/*
2 * Copyright (C) 2014 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17/*
18 Example:
19
20 MainView {
21 objectName: "mainView"
22
23 applicationName: "com.ubuntu.developer.boiko.bottomedge"
24
25 width: units.gu(100)
26 height: units.gu(75)
27
28 Component {
29 id: pageComponent
30
31 PageWithBottomEdge {
32 id: mainPage
33 title: i18n.tr("Main Page")
34
35 Rectangle {
36 anchors.fill: parent
37 color: "white"
38 }
39
40 bottomEdgePageComponent: Page {
41 title: "Contents"
42 anchors.fill: parent
43 //anchors.topMargin: contentsPage.flickable.contentY
44
45 ListView {
46 anchors.fill: parent
47 model: 50
48 delegate: ListItems.Standard {
49 text: "One Content Item: " + index
50 }
51 }
52 }
53 bottomEdgeTitle: i18n.tr("Bottom edge action")
54 }
55 }
56
57 PageStack {
58 id: stack
59 Component.onCompleted: stack.push(pageComponent)
60 }
61 }
62
63*/
64
65import QtQuick 2.2
66import Ubuntu.Components 1.1
67
68Page {
69 id: page
70
71 property alias bottomEdgePageComponent: edgeLoader.sourceComponent
72 property alias bottomEdgePageSource: edgeLoader.source
73 property alias bottomEdgeTitle: tipLabel.text
74 property bool bottomEdgeEnabled: true
75 property int bottomEdgeExpandThreshold: page.height * 0.2
76 property int bottomEdgeExposedArea: bottomEdge.state !== "expanded" ? (page.height - bottomEdge.y - bottomEdge.tipHeight) : _areaWhenExpanded
77 property bool reloadBottomEdgePage: true
78
79 readonly property alias bottomEdgePage: edgeLoader.item
80 readonly property bool isReady: ((bottomEdge.y === 0) && bottomEdgePageLoaded && edgeLoader.item.active)
81 readonly property bool isCollapsed: (bottomEdge.y === page.height)
82 readonly property bool bottomEdgePageLoaded: (edgeLoader.status == Loader.Ready)
83
84 property bool _showEdgePageWhenReady: false
85 property int _areaWhenExpanded: 0
86
87 signal bottomEdgeReleased()
88 signal bottomEdgeDismissed()
89
90
91 function showBottomEdgePage(source, properties)
92 {
93 edgeLoader.setSource(source, properties)
94 _showEdgePageWhenReady = true
95 }
96
97 function setBottomEdgePage(source, properties)
98 {
99 edgeLoader.setSource(source, properties)
100 }
101
102 function _pushPage()
103 {
104 if (edgeLoader.status === Loader.Ready) {
105 edgeLoader.item.active = true
106 page.pageStack.push(edgeLoader.item)
107 if (edgeLoader.item.flickable) {
108 edgeLoader.item.flickable.contentY = -page.header.height
109 edgeLoader.item.flickable.returnToBounds()
110 }
111 if (edgeLoader.item.ready)
112 edgeLoader.item.ready()
113 }
114 }
115
116
117 Component.onCompleted: {
118 // avoid a binding on the expanded height value
119 var expandedHeight = height;
120 _areaWhenExpanded = expandedHeight;
121 }
122
123 onActiveChanged: {
124 if (active) {
125 bottomEdge.state = "collapsed"
126 }
127 }
128
129 onBottomEdgePageLoadedChanged: {
130 if (_showEdgePageWhenReady && bottomEdgePageLoaded) {
131 bottomEdge.state = "expanded"
132 _showEdgePageWhenReady = false
133 }
134 }
135
136 Rectangle {
137 id: bgVisual
138
139 color: "black"
140 anchors.fill: page
141 opacity: 0.7 * ((page.height - bottomEdge.y) / page.height)
142 z: 1
143 }
144
145 UbuntuShape {
146 id: tip
147 objectName: "bottomEdgeTip"
148
149 property bool hidden: (activeFocus === false) || ((bottomEdge.y - units.gu(1)) < tip.y)
150
151 enabled: mouseArea.enabled
152 visible: page.bottomEdgeEnabled
153 anchors {
154 bottom: parent.bottom
155 horizontalCenter: bottomEdge.horizontalCenter
156 bottomMargin: hidden ? - height + units.gu(1) : -units.gu(1)
157 Behavior on bottomMargin {
158 SequentialAnimation {
159 // wait some msecs in case of the focus change again, to avoid flickering
160 PauseAnimation {
161 duration: 300
162 }
163 UbuntuNumberAnimation {
164 duration: UbuntuAnimation.SnapDuration
165 }
166 }
167 }
168 }
169
170 z: 1
171 width: tipLabel.paintedWidth + units.gu(6)
172 height: bottomEdge.tipHeight + units.gu(1)
173 color: Theme.palette.normal.overlay
174 Label {
175 id: tipLabel
176
177 anchors {
178 top: parent.top
179 left: parent.left
180 right: parent.right
181 }
182 height: bottomEdge.tipHeight
183 verticalAlignment: Text.AlignVCenter
184 horizontalAlignment: Text.AlignHCenter
185 opacity: tip.hidden ? 0.0 : 1.0
186 Behavior on opacity {
187 UbuntuNumberAnimation {
188 duration: UbuntuAnimation.SnapDuration
189 }
190 }
191 }
192 }
193
194 Rectangle {
195 id: shadow
196
197 anchors {
198 left: parent.left
199 right: parent.right
200 bottom: parent.bottom
201 }
202 height: units.gu(1)
203 z: 1
204 opacity: 0.0
205 gradient: Gradient {
206 GradientStop { position: 0.0; color: "transparent" }
207 GradientStop { position: 1.0; color: Qt.rgba(0, 0, 0, 0.2) }
208 }
209 }
210
211 MouseArea {
212 id: mouseArea
213
214 property real previousY: -1
215 property string dragDirection: "None"
216
217 preventStealing: true
218 drag {
219 axis: Drag.YAxis
220 target: bottomEdge
221 minimumY: bottomEdge.pageStartY
222 maximumY: page.height
223 }
224 enabled: edgeLoader.status == Loader.Ready
225 visible: page.bottomEdgeEnabled
226
227 anchors {
228 left: parent.left
229 right: parent.right
230 bottom: parent.bottom
231
232 }
233 height: bottomEdge.tipHeight
234 z: 1
235
236 onReleased: {
237 page.bottomEdgeReleased()
238 if ((dragDirection === "BottomToTop") &&
239 bottomEdge.y < (page.height - bottomEdgeExpandThreshold - bottomEdge.tipHeight)) {
240 bottomEdge.state = "expanded"
241 } else {
242 bottomEdge.state = "collapsed"
243 }
244 previousY = -1
245 dragDirection = "None"
246 }
247
248 onPressed: {
249 previousY = mouse.y
250 tip.forceActiveFocus()
251 }
252
253 onMouseYChanged: {
254 var yOffset = previousY - mouseY
255 // skip if was a small move
256 if (Math.abs(yOffset) <= units.gu(2)) {
257 return
258 }
259 previousY = mouseY
260 dragDirection = yOffset > 0 ? "BottomToTop" : "TopToBottom"
261 }
262 }
263
264 Rectangle {
265 id: bottomEdge
266 objectName: "bottomEdge"
267
268 readonly property int tipHeight: units.gu(3)
269 readonly property int pageStartY: 0
270
271 z: 1
272 color: Theme.palette.normal.background
273 clip: true
274 anchors {
275 left: parent.left
276 right: parent.right
277 }
278 height: page.height
279 y: height
280 visible: !page.isCollapsed
281 state: "collapsed"
282 states: [
283 State {
284 name: "collapsed"
285 PropertyChanges {
286 target: bottomEdge
287 y: bottomEdge.height
288 }
289 },
290 State {
291 name: "expanded"
292 PropertyChanges {
293 target: bottomEdge
294 y: bottomEdge.pageStartY
295 }
296 },
297 State {
298 name: "floating"
299 when: mouseArea.drag.active
300 PropertyChanges {
301 target: shadow
302 opacity: 1.0
303 }
304 }
305 ]
306
307 transitions: [
308 Transition {
309 to: "expanded"
310 SequentialAnimation {
311 alwaysRunToEnd: true
312
313 SmoothedAnimation {
314 target: bottomEdge
315 property: "y"
316 duration: UbuntuAnimation.FastDuration
317 easing.type: Easing.Linear
318 }
319 SmoothedAnimation {
320 target: edgeLoader
321 property: "anchors.topMargin"
322 to: - units.gu(4)
323 duration: UbuntuAnimation.FastDuration
324 easing.type: Easing.Linear
325 }
326 SmoothedAnimation {
327 target: edgeLoader
328 property: "anchors.topMargin"
329 to: 0
330 duration: UbuntuAnimation.FastDuration
331 easing: UbuntuAnimation.StandardEasing
332 }
333 ScriptAction {
334 script: page._pushPage()
335 }
336 }
337 },
338 Transition {
339 from: "expanded"
340 to: "collapsed"
341 SequentialAnimation {
342 alwaysRunToEnd: true
343
344 ScriptAction {
345 script: {
346 Qt.inputMethod.hide()
347 edgeLoader.item.parent = edgeLoader
348 edgeLoader.item.anchors.fill = edgeLoader
349 edgeLoader.item.active = false
350 }
351 }
352 SmoothedAnimation {
353 target: bottomEdge
354 property: "y"
355 duration: UbuntuAnimation.SlowDuration
356 }
357 ScriptAction {
358 script: {
359 // destroy current bottom page
360 if (page.reloadBottomEdgePage) {
361 edgeLoader.active = false
362 // tip will receive focus on page active true
363 } else {
364 tip.forceActiveFocus()
365 }
366
367 // notify
368 page.bottomEdgeDismissed()
369
370 edgeLoader.active = true
371 }
372 }
373 }
374 },
375 Transition {
376 from: "floating"
377 to: "collapsed"
378 SmoothedAnimation {
379 target: bottomEdge
380 property: "y"
381 duration: UbuntuAnimation.FastDuration
382 }
383 }
384 ]
385
386 Loader {
387 id: edgeLoader
388
389 asynchronous: true
390 anchors.fill: parent
391 //WORKAROUND: The SDK move the page contents down to allocate space for the header we need to avoid that during the page dragging
392 Binding {
393 target: edgeLoader.status === Loader.Ready ? edgeLoader : null
394 property: "anchors.topMargin"
395 value: edgeLoader.item && edgeLoader.item.flickable ? edgeLoader.item.flickable.contentY : 0
396 when: !page.isReady
397 }
398
399 onLoaded: {
400 tip.forceActiveFocus()
401 if (page.isReady && edgeLoader.item.active !== true) {
402 page._pushPage()
403 }
404 }
405 }
406 }
407}
0408
=== modified file 'WeekView.qml'
--- WeekView.qml 2014-11-06 13:57:42 +0000
+++ WeekView.qml 2014-11-16 10:11:33 +0000
@@ -21,13 +21,14 @@
21import "dateExt.js" as DateExt21import "dateExt.js" as DateExt
22import "ViewType.js" as ViewType22import "ViewType.js" as ViewType
2323
24Page{24PageWithBottomEdge{
25 id: weekViewPage25 id: weekViewPage
26 objectName: "weekViewPage"26 objectName: "weekViewPage"
2727
28 property var dayStart: new Date();28 property var dayStart: new Date();
29 property var firstDay: dayStart.weekStart(Qt.locale().firstDayOfWeek);29 property var firstDay: dayStart.weekStart(Qt.locale().firstDayOfWeek);
30 property bool isCurrentPage: false30 property bool isCurrentPage: false
31 property var eventModel;
3132
32 signal dateSelected(var date);33 signal dateSelected(var date);
3334
@@ -61,6 +62,13 @@
61 font.capitalization: Font.Capitalize62 font.capitalization: Font.Capitalize
62 }63 }
63 }64 }
65 reloadBottomEdgePage: true
66 bottomEdgeTitle : i18n.tr("New Event")
67
68 bottomEdgePageComponent : NewEvent {
69 model: eventModel
70 date: dayStart
71 }
6472
65 Column {73 Column {
66 anchors.fill: parent74 anchors.fill: parent
6775
=== modified file 'calendar.qml'
--- calendar.qml 2014-11-08 11:26:37 +0000
+++ calendar.qml 2014-11-16 10:11:33 +0000
@@ -95,7 +95,6 @@
95 footerColor: "#ECECEC"95 footerColor: "#ECECEC"
96 anchorToKeyboard: true96 anchorToKeyboard: true
9797
98
99 PageStack {98 PageStack {
100 id: pageStack99 id: pageStack
101100
@@ -360,6 +359,7 @@
360 source: tabs.selectedTab == monthTab ? Qt.resolvedUrl("MonthView.qml"):""359 source: tabs.selectedTab == monthTab ? Qt.resolvedUrl("MonthView.qml"):""
361 onLoaded: {360 onLoaded: {
362 item.currentMonth = tabs.currentDay.midnight();361 item.currentMonth = tabs.currentDay.midnight();
362 item.eventModel = eventModel
363 }363 }
364364
365 anchors{365 anchors{
@@ -374,6 +374,7 @@
374 tabs.currentDay = date;374 tabs.currentDay = date;
375 tabs.selectedTabIndex = dayTab.index;375 tabs.selectedTabIndex = dayTab.index;
376 }376 }
377
377 }378 }
378 }379 }
379 }380 }
@@ -389,6 +390,7 @@
389 onLoaded: {390 onLoaded: {
390 item.isCurrentPage= Qt.binding(function() { return tabs.selectedTab == weekTab })391 item.isCurrentPage= Qt.binding(function() { return tabs.selectedTab == weekTab })
391 item.dayStart = tabs.currentDay;392 item.dayStart = tabs.currentDay;
393 item.eventModel = eventModel
392 }394 }
393395
394 anchors{396 anchors{
@@ -402,7 +404,6 @@
402 onDayStartChanged: {404 onDayStartChanged: {
403 tabs.currentDay = weekViewLoader.item.dayStart;405 tabs.currentDay = weekViewLoader.item.dayStart;
404 }406 }
405
406 onDateSelected: {407 onDateSelected: {
407 tabs.currentDay = date;408 tabs.currentDay = date;
408 tabs.selectedTabIndex = dayTab.index;409 tabs.selectedTabIndex = dayTab.index;
@@ -422,6 +423,8 @@
422 onLoaded: {423 onLoaded: {
423 item.isCurrentPage= Qt.binding(function() { return tabs.selectedTab == dayTab })424 item.isCurrentPage= Qt.binding(function() { return tabs.selectedTab == dayTab })
424 item.currentDay = tabs.currentDay;425 item.currentDay = tabs.currentDay;
426 item.eventModel = eventModel
427
425 }428 }
426429
427 anchors{430 anchors{

Subscribers

People subscribed via source and target branches

to status/vote changes: