Merge lp:~ubuntu-calendar-dev/ubuntu-calendar-app/2-Improve-WeekView into lp:ubuntu-calendar-app

Proposed by Nekhelesh Ramananthan
Status: Merged
Approved by: Mihir Soni
Approved revision: 468
Merged at revision: 460
Proposed branch: lp:~ubuntu-calendar-dev/ubuntu-calendar-app/2-Improve-WeekView
Merge into: lp:ubuntu-calendar-app
Diff against target: 389 lines (+85/-98)
9 files modified
HeaderDateComponent.qml (+22/-20)
TimeLineBackground.qml (+8/-11)
TimeLineBaseComponent.qml (+8/-13)
TimeLineHeader.qml (+6/-14)
TimeLineHeaderComponent.qml (+6/-7)
WeekView.qml (+26/-23)
debian/control (+1/-2)
tests/autopilot/calendar_app/__init__.py (+4/-0)
tests/autopilot/calendar_app/tests/test_weekview.py (+4/-8)
To merge this branch: bzr merge lp:~ubuntu-calendar-dev/ubuntu-calendar-app/2-Improve-WeekView
Reviewer Review Type Date Requested Status
Mihir Soni Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+235271@code.launchpad.net

Commit message

- Remove qtquick2-plugin, localstorage-plugin from debian control since these 2 packages are dependencies of the ubuntu-ui-toolkit itself and is automatically installed.

- Improved the font contrast of the time shown in the timeline by removing opacity from TimeLineBackground.qml

- Cleaned and improved code readability of HeaderDateComponent.qml, TimeLineBaseComponent.qml

- Improved Week View

- Replaced hard code color hex codes in TimeLineHeaderComponent.qml with proper ubuntu colors.

Description of the change

The MP does the following,

- Remove qtquick2-plugin, localstorage-plugin from debian control since these 2 packages are dependencies of the ubuntu-ui-toolkit itself and is automatically installed.

- Improved the font contrast of the time shown in the timeline by removing opacity from TimeLineBackground.qml

- Cleaned and improved code readability of HeaderDateComponent.qml, TimeLineBaseComponent.qml

- Improved Week View

- Replaced hard code color hex codes in TimeLineHeaderComponent.qml with proper ubuntu colors.

To post a comment you must log in.
466. By Nekhelesh Ramananthan

Added missing dependency

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)
467. By Nekhelesh Ramananthan

Fixed AP

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
468. By Mihir Soni

reverting AP , needs to be changed in Dayview MR

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

I pushed the changes in AP, it should fix now.

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 :

Lgtm.
Thanks for your time in splitting these MRs

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'HeaderDateComponent.qml'
2--- HeaderDateComponent.qml 2014-09-02 00:02:38 +0000
3+++ HeaderDateComponent.qml 2014-09-19 13:03:20 +0000
4@@ -15,46 +15,48 @@
5 * You should have received a copy of the GNU General Public License
6 * along with this program. If not, see <http://www.gnu.org/licenses/>.
7 */
8-import QtQuick 2.0
9+
10+import QtQuick 2.3
11 import Ubuntu.Components 1.1
12
13 Item {
14 id: root
15
16+ // Property to set the day and date
17 property var date;
18
19- property alias dateColor: dateLabel.color
20+ // Property to set the font color of the day label
21 property alias dayColor: dayLabel.color
22
23- property int dayFormat: Locale.ShortFormat;
24-
25- signal dateSelected(var date);
26-
27- width: parent.width
28- height: innerColumn.height
29+ // Property to set the time format of the day label
30+ property int dayFormat: Locale.ShortFormat
31+
32+ // Signal fired when pressing on the date
33+ signal dateSelected(var date)
34+
35+ width: dayLabel.paintedWidth
36+ height: dateContainer.height
37
38 Column {
39- id: innerColumn
40- width: parent.width
41- spacing: units.gu(2)
42+ id: dateContainer
43+
44+ width: dayLabel.paintedWidth
45+ spacing: units.gu(0.2)
46+
47+ anchors.centerIn: parent
48
49 Label{
50 id: dayLabel
51- property var day: Qt.locale().standaloneDayName(date.getDay(), dayFormat)
52- text: day.toUpperCase();
53- fontSize: "medium"
54- horizontalAlignment: Text.AlignHCenter
55- color: "white"
56- width: parent.width
57+ objectName: "dayLabel"
58+ text: Qt.locale().standaloneDayName(date.getDay(), dayFormat)
59 }
60
61 Label{
62 id: dateLabel
63 objectName: "dateLabel"
64 text: date.getDate();
65- fontSize: "large"
66- horizontalAlignment: Text.AlignHCenter
67- width: parent.width
68+ color: dayLabel.color
69+ anchors.horizontalCenter: dayLabel.horizontalCenter
70 }
71 }
72
73
74=== modified file 'TimeLineBackground.qml'
75--- TimeLineBackground.qml 2014-09-08 10:21:19 +0000
76+++ TimeLineBackground.qml 2014-09-19 13:03:20 +0000
77@@ -15,11 +15,13 @@
78 * You should have received a copy of the GNU General Public License
79 * along with this program. If not, see <http://www.gnu.org/licenses/>.
80 */
81-import QtQuick 2.0
82+
83+import QtQuick 2.3
84 import Ubuntu.Components 1.1
85
86 Column {
87 width: parent.width
88+
89 Repeater {
90 model: 24 // hour in a day
91
92@@ -31,19 +33,14 @@
93 Label {
94 id: timeLabel
95
96- // TRANSLATORS: this is a time formatting string,
97- // see http://qt-project.org/doc/qt-5.0/qtqml/qml-qtquick2-date.html#details for valid expressions
98 text: {
99- var locale = Qt.locale();
100-
101- return new Date( 0, 0, 0, index )
102- .toLocaleTimeString( locale, locale.timeFormat( Locale.NarrowFormat ) );
103+ var locale = Qt.locale()
104+ return new Date(0, 0, 0, index).toLocaleTimeString
105+ (locale, locale.timeFormat(Locale.NarrowFormat))
106 }
107- color: "#5D5D5D"
108- anchors.horizontalCenter: parent.horizontalCenter
109- anchors.verticalCenter: parent.verticalCenter
110+ color: UbuntuColors.lightGrey
111+ anchors.centerIn: parent
112 fontSize: "x-large"
113- opacity: 0.3
114 }
115 }
116 }
117
118=== modified file 'TimeLineBaseComponent.qml'
119--- TimeLineBaseComponent.qml 2014-09-02 00:02:38 +0000
120+++ TimeLineBaseComponent.qml 2014-09-19 13:03:20 +0000
121@@ -15,11 +15,12 @@
122 * You should have received a copy of the GNU General Public License
123 * along with this program. If not, see <http://www.gnu.org/licenses/>.
124 */
125-import QtQuick 2.0
126+
127+import QtQuick 2.3
128+import QtQuick.Layouts 1.1
129 import Ubuntu.Components 1.1
130 import Ubuntu.Components.Popups 1.0
131 import QtOrganizer 5.0
132-
133 import "dateExt.js" as DateExt
134 import "ViewType.js" as ViewType
135
136@@ -88,11 +89,8 @@
137 z:2
138 }
139
140- Column {
141- anchors.top: parent.top
142-
143- width: parent.width
144- height: parent.height
145+ ColumnLayout {
146+ anchors.fill: parent
147
148 AllDayEventComponent {
149 id: allDayContainer
150@@ -111,21 +109,18 @@
151 id: timeLineView
152
153 width: parent.width
154- height: parent.height - allDayContainer.height
155+ Layout.fillHeight: true
156
157 contentHeight: units.gu(10) * 24
158 contentWidth: width
159
160 clip: true
161
162- TimeLineBackground {
163- }
164+ TimeLineBackground {}
165
166 Row {
167 id: week
168- width: parent.width
169- height: parent.height
170- anchors.top: parent.top
171+ anchors.fill: parent
172
173 Repeater {
174 model: type == ViewType.ViewTypeWeek ? 7 : 1
175
176=== modified file 'TimeLineHeader.qml'
177--- TimeLineHeader.qml 2014-09-02 00:02:38 +0000
178+++ TimeLineHeader.qml 2014-09-19 13:03:20 +0000
179@@ -15,10 +15,9 @@
180 * You should have received a copy of the GNU General Public License
181 * along with this program. If not, see <http://www.gnu.org/licenses/>.
182 */
183-import QtQuick 2.0
184+
185+import QtQuick 2.3
186 import Ubuntu.Components 1.1
187-
188-import "dateExt.js" as DateExt
189 import "ViewType.js" as ViewType
190
191 PathViewBase {
192@@ -29,17 +28,13 @@
193 interactive: false
194 model:3
195
196- height: units.gu(8)
197+ height: units.gu(4)
198 width: parent.width
199
200 property var date;
201
202 signal dateSelected(var date);
203
204- DayHeaderBackground{
205- height: FontUtils.sizeToPixels("medium") + units.gu(1.5)
206- }
207-
208 delegate: TimeLineHeaderComponent{
209 type: header.type
210
211@@ -47,7 +42,7 @@
212
213 width: {
214 if( type == ViewType.ViewTypeWeek ) {
215- parent.width
216+ parent.width
217 } else if( type == ViewType.ViewTypeDay && isCurrentItem ){
218 (header.width/7) * 5
219 } else {
220@@ -55,11 +50,8 @@
221 }
222 }
223
224- startDay: {
225- (type == ViewType.ViewTypeWeek) ?
226- date.addDays(7*header.indexType(index)) :
227- date.addDays(1*header.indexType(index));
228- }
229+ startDay: type == ViewType.ViewTypeWeek ? date.addDays(7*header.indexType(index))
230+ : date.addDays(1*header.indexType(index))
231
232 onDateSelected: {
233 header.dateSelected(date);
234
235=== modified file 'TimeLineHeaderComponent.qml'
236--- TimeLineHeaderComponent.qml 2014-09-02 00:02:38 +0000
237+++ TimeLineHeaderComponent.qml 2014-09-19 13:03:20 +0000
238@@ -15,13 +15,12 @@
239 * You should have received a copy of the GNU General Public License
240 * along with this program. If not, see <http://www.gnu.org/licenses/>.
241 */
242-import QtQuick 2.0
243+
244+import QtQuick 2.3
245 import Ubuntu.Components 1.1
246-
247 import "dateExt.js" as DateExt
248 import "ViewType.js" as ViewType
249
250-
251 Row{
252 id: header
253
254@@ -47,13 +46,13 @@
255 }
256 }
257
258- dateColor: {
259+ dayColor: {
260 if( type == ViewType.ViewTypeWeek && date.isSameDay(DateExt.today())){
261- "#5D5D5D"
262+ UbuntuColors.orange
263 } else if( type == ViewType.ViewTypeDay && header.isCurrentItem ) {
264- "#5D5D5D"
265+ UbuntuColors.orange
266 } else {
267- "#AEA79F"
268+ UbuntuColors.darkGrey
269 }
270 }
271
272
273=== modified file 'WeekView.qml'
274--- WeekView.qml 2014-09-19 09:37:30 +0000
275+++ WeekView.qml 2014-09-19 13:03:20 +0000
276@@ -34,35 +34,38 @@
277 Keys.forwardTo: [weekViewPath]
278
279 flickable: null
280+
281 Action {
282- id: calendarTodayAction
283- objectName:"todaybutton"
284- iconName: "calendar-today"
285- text: i18n.tr("Today")
286- onTriggered: {
287- dayStart = new Date()
288- }
289- }
290-
291- head.actions: [
292- calendarTodayAction,
293- commonHeaderActions.newEventAction,
294- commonHeaderActions.showCalendarAction,
295- commonHeaderActions.reloadAction
296- ]
297+ id: calendarTodayAction
298+ objectName:"todaybutton"
299+ iconName: "calendar-today"
300+ text: i18n.tr("Today")
301+ onTriggered: {
302+ dayStart = new Date()
303+ }
304+ }
305+
306+ head {
307+ actions: [
308+ calendarTodayAction,
309+ commonHeaderActions.newEventAction,
310+ commonHeaderActions.showCalendarAction,
311+ commonHeaderActions.reloadAction
312+ ]
313+
314+ contents: Label {
315+ id:monthYear
316+ objectName:"monthYearLabel"
317+ fontSize: "x-large"
318+ text: i18n.tr(dayStart.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy")))
319+ }
320+ }
321
322 Column {
323 anchors.fill: parent
324- anchors.top: parent.top
325- anchors.topMargin: units.gu(1.5)
326+ anchors.topMargin: units.gu(1)
327 spacing: units.gu(1)
328
329- ViewHeader{
330- id: viewHeader
331- month: dayStart.getMonth()
332- year: dayStart.getFullYear()
333- }
334-
335 TimeLineHeader{
336 id: weekHeader
337 objectName: "weekHeader"
338
339=== modified file 'debian/control'
340--- debian/control 2014-09-05 15:24:20 +0000
341+++ debian/control 2014-09-19 13:03:20 +0000
342@@ -18,8 +18,7 @@
343 Architecture: all
344 Depends: ${misc:Depends},
345 qmlscene,
346- qtdeclarative5-localstorage-plugin,
347- qtdeclarative5-qtquick2-plugin,
348+ qtdeclarative5-quicklayouts-plugin,
349 qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu,
350 ${misc:Depends},
351 libqt5organizer5,
352
353=== modified file 'tests/autopilot/calendar_app/__init__.py'
354--- tests/autopilot/calendar_app/__init__.py 2014-09-15 18:02:26 +0000
355+++ tests/autopilot/calendar_app/__init__.py 2014-09-19 13:03:20 +0000
356@@ -183,6 +183,10 @@
357 else:
358 return None
359
360+ def get_month_year(self, component):
361+ return self.wait_select_single(
362+ "Label", objectName="monthYearLabel").text
363+
364 def get_year(self, component):
365 return int(component.wait_select_single(
366 "Label", objectName="yearLabel").text)
367
368=== modified file 'tests/autopilot/calendar_app/tests/test_weekview.py'
369--- tests/autopilot/calendar_app/tests/test_weekview.py 2014-09-04 16:36:09 +0000
370+++ tests/autopilot/calendar_app/tests/test_weekview.py 2014-09-19 13:03:20 +0000
371@@ -123,14 +123,10 @@
372
373 now = datetime.datetime.now()
374
375- expected_year = now.year
376- expected_month_name = now.strftime("%B")
377-
378- self.assertThat(self.app.main_view.get_year(self.week_view),
379- Equals(expected_year))
380-
381- self.assertThat(self.app.main_view.get_month_name(self.week_view),
382- Equals(expected_month_name))
383+ expected_month_name_year = now.strftime("%B %Y")
384+
385+ self.assertThat(self.app.main_view.get_month_year(self.week_view),
386+ Equals(expected_month_name_year))
387
388 def test_current_week_is_selected(self):
389 """By default, the week view shows the current week."""

Subscribers

People subscribed via source and target branches

to status/vote changes: