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

Proposed by Kunal Parmar
Status: Merged
Approved by: Mihir Soni
Approved revision: 553
Merged at revision: 556
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/NewTimeLineBg
Merge into: lp:ubuntu-calendar-app
Diff against target: 204 lines (+101/-32)
5 files modified
SimpleDivider.qml (+25/-0)
TimeLineBackground.qml (+4/-26)
TimeLineBase.qml (+1/-1)
TimeLineBaseComponent.qml (+10/-5)
TimeLineTimeScale.qml (+61/-0)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/NewTimeLineBg
Reviewer Review Type Date Requested Status
Mihir Soni Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Nekhelesh Ramananthan Needs Fixing
Review via email: mp+242339@code.launchpad.net

Commit message

Timeline background chnges required for new day and week view support

Description of the change

Timeline background chnges required for new day and week view support

To post a comment you must log in.
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

This change remove time scale from Timeline bg, I created another component for time scale.

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
Nekhelesh Ramananthan (nik90) wrote :

> This change remove time scale from Timeline bg, I created another component
> for time scale.

I see that you removed the time scale which is fine and added a new component called TimeLineTimeScale.qml. However since TimeLineTimeScale.qml is not being used, it is hard to tell as a reviewer if it works properly or not.

Would it not be possible to add the code necessary to use the new time scale component in this MP itself?

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

> Would it not be possible to add the code necessary to use the new time scale
> component in this MP itself?

Sure, will add some temp code to use it

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

Hello, I added the requied code to use Time Scale component.
Let me know if you have more feedback.

Thanks

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
Mihir Soni (mihirsoni) wrote :

Looks good to me !!
Thanks Kunal.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'SimpleDivider.qml'
2--- SimpleDivider.qml 1970-01-01 00:00:00 +0000
3+++ SimpleDivider.qml 2014-11-26 00:13:59 +0000
4@@ -0,0 +1,25 @@
5+/*
6+ * Copyright (C) 2013-2014 Canonical Ltd
7+ *
8+ * This file is part of Ubuntu Calendar App
9+ *
10+ * Ubuntu Calendar App is free software: you can redistribute it and/or modify
11+ * it under the terms of the GNU General Public License version 3 as
12+ * published by the Free Software Foundation.
13+ *
14+ * Ubuntu Calendar App is distributed in the hope that it will be useful,
15+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+ * GNU General Public License for more details.
18+ *
19+ * You should have received a copy of the GNU General Public License
20+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21+ */
22+
23+import QtQuick 2.0
24+
25+Rectangle{
26+ height: units.gu(0.1)
27+ width: parent.width
28+ color: "#e5e2e2"
29+}
30
31=== modified file 'TimeLineBackground.qml'
32--- TimeLineBackground.qml 2014-10-04 02:19:01 +0000
33+++ TimeLineBackground.qml 2014-11-26 00:13:59 +0000
34@@ -21,35 +21,13 @@
35
36 Column {
37 width: parent.width
38-
39 Repeater {
40 model: 24 // hour in a day
41-
42- delegate: Rectangle {
43+ delegate: Item {
44 width: parent.width
45- height: units.gu(10)
46- color: (index % 2 == 0) ? "#F5F5F5" : "#ECECEC"
47-
48- Label {
49- id: timeLabel
50- width: (parent.width / 7) - units.gu(1)
51- wrapMode: Text.WordWrap
52-
53- text: {
54- var locale = Qt.locale()
55- return new Date(0, 0, 0, index).toLocaleTimeString
56- (locale, locale.timeFormat(Locale.NarrowFormat))
57- }
58-
59- anchors {
60- left: parent.left
61- leftMargin: units.gu(0.5)
62- verticalCenter: parent.verticalCenter
63- }
64-
65- color: UbuntuColors.lightGrey
66- fontSize: "small"
67- }
68+ height: units.gu(8)
69+
70+ SimpleDivider{}
71 }
72 }
73 }
74
75=== modified file 'TimeLineBase.qml'
76--- TimeLineBase.qml 2014-11-08 02:16:45 +0000
77+++ TimeLineBase.qml 2014-11-26 00:13:59 +0000
78@@ -24,7 +24,7 @@
79
80 property var delegate;
81 property var day;
82- property int hourHeight: units.gu(10)
83+ property int hourHeight: units.gu(8)
84 property var model;
85
86 Component.onCompleted: {
87
88=== modified file 'TimeLineBaseComponent.qml'
89--- TimeLineBaseComponent.qml 2014-11-08 02:27:16 +0000
90+++ TimeLineBaseComponent.qml 2014-11-26 00:13:59 +0000
91@@ -43,7 +43,7 @@
92 var currentTime = new Date();
93 scrollHour = currentTime.getHours();
94
95- timeLineView.contentY = scrollHour * units.gu(10);
96+ timeLineView.contentY = scrollHour * units.gu(8);
97 if(timeLineView.contentY >= timeLineView.contentHeight - timeLineView.height) {
98 timeLineView.contentY = timeLineView.contentHeight - timeLineView.height
99 }
100@@ -61,7 +61,7 @@
101
102 onScrollDown:{
103 scrollHour++;
104- var visibleHour = root.height / units.gu(10);
105+ var visibleHour = root.height / units.gu(8);
106 if( scrollHour > (25 -visibleHour)) {
107 scrollHour = 25 - visibleHour;
108 }
109@@ -70,7 +70,7 @@
110 }
111
112 function scrollToHour() {
113- timeLineView.contentY = scrollHour * units.gu(10);
114+ timeLineView.contentY = scrollHour * units.gu(8);
115 if(timeLineView.contentY >= timeLineView.contentHeight - timeLineView.height) {
116 timeLineView.contentY = timeLineView.contentHeight - timeLineView.height
117 }
118@@ -108,13 +108,18 @@
119 Flickable {
120 id: timeLineView
121
122- contentHeight: units.gu(10) * 24
123+ contentHeight: units.gu(8) * 24
124 contentWidth: width
125 anchors.fill: parent
126
127 clip: true
128
129- TimeLineBackground {}
130+ Row {
131+ width: parent.width
132+ height: timeLineView.contentHeight
133+ TimeLineTimeScale{ id: timeScale }
134+ TimeLineBackground { width: parent.width - x}
135+ }
136
137 Row {
138 id: week
139
140=== added file 'TimeLineTimeScale.qml'
141--- TimeLineTimeScale.qml 1970-01-01 00:00:00 +0000
142+++ TimeLineTimeScale.qml 2014-11-26 00:13:59 +0000
143@@ -0,0 +1,61 @@
144+/*
145+ * Copyright (C) 2013-2014 Canonical Ltd
146+ *
147+ * This file is part of Ubuntu Calendar App
148+ *
149+ * Ubuntu Calendar App is free software: you can redistribute it and/or modify
150+ * it under the terms of the GNU General Public License version 3 as
151+ * published by the Free Software Foundation.
152+ *
153+ * Ubuntu Calendar App is distributed in the hope that it will be useful,
154+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
155+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
156+ * GNU General Public License for more details.
157+ *
158+ * You should have received a copy of the GNU General Public License
159+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
160+ */
161+
162+import QtQuick 2.0
163+import Ubuntu.Components 1.1
164+
165+Flickable{
166+ id: timeFlickble
167+
168+ height: parent.height
169+ width: units.gu(6)
170+
171+ contentHeight: 24 * units.gu(8)
172+ contentWidth: width
173+
174+ interactive: false
175+
176+ clip: true
177+
178+ Column {
179+ id: timeLine
180+ width: parent.width
181+
182+ Repeater {
183+ model: 24 // hour in a day
184+
185+ delegate: Item {
186+ width: parent.width
187+ height: units.gu(8)
188+
189+ Label {
190+ id: timeLabel
191+ width: units.gu(5)
192+ anchors.top: parent.top
193+ anchors.topMargin: units.gu(0.5)
194+ horizontalAlignment: Text.AlignRight
195+ text: Qt.formatTime( new Date(0,0,0,index), "hh:mm")
196+ color: UbuntuColors.lightGrey
197+ fontSize: "small"
198+ }
199+
200+ SimpleDivider{}
201+ }
202+ }
203+ }
204+}

Subscribers

People subscribed via source and target branches

to status/vote changes: