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
=== modified file 'HeaderDateComponent.qml'
--- HeaderDateComponent.qml 2014-09-02 00:02:38 +0000
+++ HeaderDateComponent.qml 2014-09-19 13:03:20 +0000
@@ -15,46 +15,48 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.018
19import QtQuick 2.3
19import Ubuntu.Components 1.120import Ubuntu.Components 1.1
2021
21Item {22Item {
22 id: root23 id: root
2324
25 // Property to set the day and date
24 property var date;26 property var date;
2527
26 property alias dateColor: dateLabel.color28 // Property to set the font color of the day label
27 property alias dayColor: dayLabel.color29 property alias dayColor: dayLabel.color
2830
29 property int dayFormat: Locale.ShortFormat;31 // Property to set the time format of the day label
3032 property int dayFormat: Locale.ShortFormat
31 signal dateSelected(var date);33
3234 // Signal fired when pressing on the date
33 width: parent.width35 signal dateSelected(var date)
34 height: innerColumn.height36
37 width: dayLabel.paintedWidth
38 height: dateContainer.height
3539
36 Column {40 Column {
37 id: innerColumn41 id: dateContainer
38 width: parent.width42
39 spacing: units.gu(2)43 width: dayLabel.paintedWidth
44 spacing: units.gu(0.2)
45
46 anchors.centerIn: parent
4047
41 Label{48 Label{
42 id: dayLabel49 id: dayLabel
43 property var day: Qt.locale().standaloneDayName(date.getDay(), dayFormat)50 objectName: "dayLabel"
44 text: day.toUpperCase();51 text: Qt.locale().standaloneDayName(date.getDay(), dayFormat)
45 fontSize: "medium"
46 horizontalAlignment: Text.AlignHCenter
47 color: "white"
48 width: parent.width
49 }52 }
5053
51 Label{54 Label{
52 id: dateLabel55 id: dateLabel
53 objectName: "dateLabel"56 objectName: "dateLabel"
54 text: date.getDate();57 text: date.getDate();
55 fontSize: "large"58 color: dayLabel.color
56 horizontalAlignment: Text.AlignHCenter59 anchors.horizontalCenter: dayLabel.horizontalCenter
57 width: parent.width
58 }60 }
59 }61 }
6062
6163
=== modified file 'TimeLineBackground.qml'
--- TimeLineBackground.qml 2014-09-08 10:21:19 +0000
+++ TimeLineBackground.qml 2014-09-19 13:03:20 +0000
@@ -15,11 +15,13 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.018
19import QtQuick 2.3
19import Ubuntu.Components 1.120import Ubuntu.Components 1.1
2021
21Column {22Column {
22 width: parent.width23 width: parent.width
24
23 Repeater {25 Repeater {
24 model: 24 // hour in a day26 model: 24 // hour in a day
2527
@@ -31,19 +33,14 @@
31 Label {33 Label {
32 id: timeLabel34 id: timeLabel
3335
34 // TRANSLATORS: this is a time formatting string,
35 // see http://qt-project.org/doc/qt-5.0/qtqml/qml-qtquick2-date.html#details for valid expressions
36 text: {36 text: {
37 var locale = Qt.locale();37 var locale = Qt.locale()
3838 return new Date(0, 0, 0, index).toLocaleTimeString
39 return new Date( 0, 0, 0, index )39 (locale, locale.timeFormat(Locale.NarrowFormat))
40 .toLocaleTimeString( locale, locale.timeFormat( Locale.NarrowFormat ) );
41 }40 }
42 color: "#5D5D5D"41 color: UbuntuColors.lightGrey
43 anchors.horizontalCenter: parent.horizontalCenter42 anchors.centerIn: parent
44 anchors.verticalCenter: parent.verticalCenter
45 fontSize: "x-large"43 fontSize: "x-large"
46 opacity: 0.3
47 }44 }
48 }45 }
49 }46 }
5047
=== modified file 'TimeLineBaseComponent.qml'
--- TimeLineBaseComponent.qml 2014-09-02 00:02:38 +0000
+++ TimeLineBaseComponent.qml 2014-09-19 13:03:20 +0000
@@ -15,11 +15,12 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.018
19import QtQuick 2.3
20import QtQuick.Layouts 1.1
19import Ubuntu.Components 1.121import Ubuntu.Components 1.1
20import Ubuntu.Components.Popups 1.022import Ubuntu.Components.Popups 1.0
21import QtOrganizer 5.023import QtOrganizer 5.0
22
23import "dateExt.js" as DateExt24import "dateExt.js" as DateExt
24import "ViewType.js" as ViewType25import "ViewType.js" as ViewType
2526
@@ -88,11 +89,8 @@
88 z:289 z:2
89 }90 }
9091
91 Column {92 ColumnLayout {
92 anchors.top: parent.top93 anchors.fill: parent
93
94 width: parent.width
95 height: parent.height
9694
97 AllDayEventComponent {95 AllDayEventComponent {
98 id: allDayContainer96 id: allDayContainer
@@ -111,21 +109,18 @@
111 id: timeLineView109 id: timeLineView
112110
113 width: parent.width111 width: parent.width
114 height: parent.height - allDayContainer.height112 Layout.fillHeight: true
115113
116 contentHeight: units.gu(10) * 24114 contentHeight: units.gu(10) * 24
117 contentWidth: width115 contentWidth: width
118116
119 clip: true117 clip: true
120118
121 TimeLineBackground {119 TimeLineBackground {}
122 }
123120
124 Row {121 Row {
125 id: week122 id: week
126 width: parent.width123 anchors.fill: parent
127 height: parent.height
128 anchors.top: parent.top
129124
130 Repeater {125 Repeater {
131 model: type == ViewType.ViewTypeWeek ? 7 : 1126 model: type == ViewType.ViewTypeWeek ? 7 : 1
132127
=== modified file 'TimeLineHeader.qml'
--- TimeLineHeader.qml 2014-09-02 00:02:38 +0000
+++ TimeLineHeader.qml 2014-09-19 13:03:20 +0000
@@ -15,10 +15,9 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.018
19import QtQuick 2.3
19import Ubuntu.Components 1.120import Ubuntu.Components 1.1
20
21import "dateExt.js" as DateExt
22import "ViewType.js" as ViewType21import "ViewType.js" as ViewType
2322
24PathViewBase {23PathViewBase {
@@ -29,17 +28,13 @@
29 interactive: false28 interactive: false
30 model:329 model:3
3130
32 height: units.gu(8)31 height: units.gu(4)
33 width: parent.width32 width: parent.width
3433
35 property var date;34 property var date;
3635
37 signal dateSelected(var date);36 signal dateSelected(var date);
3837
39 DayHeaderBackground{
40 height: FontUtils.sizeToPixels("medium") + units.gu(1.5)
41 }
42
43 delegate: TimeLineHeaderComponent{38 delegate: TimeLineHeaderComponent{
44 type: header.type39 type: header.type
4540
@@ -47,7 +42,7 @@
4742
48 width: {43 width: {
49 if( type == ViewType.ViewTypeWeek ) {44 if( type == ViewType.ViewTypeWeek ) {
50 parent.width45 parent.width
51 } else if( type == ViewType.ViewTypeDay && isCurrentItem ){46 } else if( type == ViewType.ViewTypeDay && isCurrentItem ){
52 (header.width/7) * 547 (header.width/7) * 5
53 } else {48 } else {
@@ -55,11 +50,8 @@
55 }50 }
56 }51 }
5752
58 startDay: {53 startDay: type == ViewType.ViewTypeWeek ? date.addDays(7*header.indexType(index))
59 (type == ViewType.ViewTypeWeek) ?54 : date.addDays(1*header.indexType(index))
60 date.addDays(7*header.indexType(index)) :
61 date.addDays(1*header.indexType(index));
62 }
6355
64 onDateSelected: {56 onDateSelected: {
65 header.dateSelected(date);57 header.dateSelected(date);
6658
=== modified file 'TimeLineHeaderComponent.qml'
--- TimeLineHeaderComponent.qml 2014-09-02 00:02:38 +0000
+++ TimeLineHeaderComponent.qml 2014-09-19 13:03:20 +0000
@@ -15,13 +15,12 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.018
19import QtQuick 2.3
19import Ubuntu.Components 1.120import Ubuntu.Components 1.1
20
21import "dateExt.js" as DateExt21import "dateExt.js" as DateExt
22import "ViewType.js" as ViewType22import "ViewType.js" as ViewType
2323
24
25Row{24Row{
26 id: header25 id: header
2726
@@ -47,13 +46,13 @@
47 }46 }
48 }47 }
4948
50 dateColor: {49 dayColor: {
51 if( type == ViewType.ViewTypeWeek && date.isSameDay(DateExt.today())){50 if( type == ViewType.ViewTypeWeek && date.isSameDay(DateExt.today())){
52 "#5D5D5D"51 UbuntuColors.orange
53 } else if( type == ViewType.ViewTypeDay && header.isCurrentItem ) {52 } else if( type == ViewType.ViewTypeDay && header.isCurrentItem ) {
54 "#5D5D5D"53 UbuntuColors.orange
55 } else {54 } else {
56 "#AEA79F"55 UbuntuColors.darkGrey
57 }56 }
58 }57 }
5958
6059
=== modified file 'WeekView.qml'
--- WeekView.qml 2014-09-19 09:37:30 +0000
+++ WeekView.qml 2014-09-19 13:03:20 +0000
@@ -34,35 +34,38 @@
34 Keys.forwardTo: [weekViewPath]34 Keys.forwardTo: [weekViewPath]
3535
36 flickable: null36 flickable: null
37
37 Action {38 Action {
38 id: calendarTodayAction39 id: calendarTodayAction
39 objectName:"todaybutton"40 objectName:"todaybutton"
40 iconName: "calendar-today"41 iconName: "calendar-today"
41 text: i18n.tr("Today")42 text: i18n.tr("Today")
42 onTriggered: {43 onTriggered: {
43 dayStart = new Date()44 dayStart = new Date()
44 }45 }
45 }46 }
4647
47 head.actions: [48 head {
48 calendarTodayAction,49 actions: [
49 commonHeaderActions.newEventAction,50 calendarTodayAction,
50 commonHeaderActions.showCalendarAction,51 commonHeaderActions.newEventAction,
51 commonHeaderActions.reloadAction52 commonHeaderActions.showCalendarAction,
52 ]53 commonHeaderActions.reloadAction
54 ]
55
56 contents: Label {
57 id:monthYear
58 objectName:"monthYearLabel"
59 fontSize: "x-large"
60 text: i18n.tr(dayStart.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy")))
61 }
62 }
5363
54 Column {64 Column {
55 anchors.fill: parent65 anchors.fill: parent
56 anchors.top: parent.top66 anchors.topMargin: units.gu(1)
57 anchors.topMargin: units.gu(1.5)
58 spacing: units.gu(1)67 spacing: units.gu(1)
5968
60 ViewHeader{
61 id: viewHeader
62 month: dayStart.getMonth()
63 year: dayStart.getFullYear()
64 }
65
66 TimeLineHeader{69 TimeLineHeader{
67 id: weekHeader70 id: weekHeader
68 objectName: "weekHeader"71 objectName: "weekHeader"
6972
=== modified file 'debian/control'
--- debian/control 2014-09-05 15:24:20 +0000
+++ debian/control 2014-09-19 13:03:20 +0000
@@ -18,8 +18,7 @@
18Architecture: all18Architecture: all
19Depends: ${misc:Depends},19Depends: ${misc:Depends},
20 qmlscene,20 qmlscene,
21 qtdeclarative5-localstorage-plugin,21 qtdeclarative5-quicklayouts-plugin,
22 qtdeclarative5-qtquick2-plugin,
23 qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu,22 qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu,
24 ${misc:Depends},23 ${misc:Depends},
25 libqt5organizer5,24 libqt5organizer5,
2625
=== modified file 'tests/autopilot/calendar_app/__init__.py'
--- tests/autopilot/calendar_app/__init__.py 2014-09-15 18:02:26 +0000
+++ tests/autopilot/calendar_app/__init__.py 2014-09-19 13:03:20 +0000
@@ -183,6 +183,10 @@
183 else:183 else:
184 return None184 return None
185185
186 def get_month_year(self, component):
187 return self.wait_select_single(
188 "Label", objectName="monthYearLabel").text
189
186 def get_year(self, component):190 def get_year(self, component):
187 return int(component.wait_select_single(191 return int(component.wait_select_single(
188 "Label", objectName="yearLabel").text)192 "Label", objectName="yearLabel").text)
189193
=== modified file 'tests/autopilot/calendar_app/tests/test_weekview.py'
--- tests/autopilot/calendar_app/tests/test_weekview.py 2014-09-04 16:36:09 +0000
+++ tests/autopilot/calendar_app/tests/test_weekview.py 2014-09-19 13:03:20 +0000
@@ -123,14 +123,10 @@
123123
124 now = datetime.datetime.now()124 now = datetime.datetime.now()
125125
126 expected_year = now.year126 expected_month_name_year = now.strftime("%B %Y")
127 expected_month_name = now.strftime("%B")127
128128 self.assertThat(self.app.main_view.get_month_year(self.week_view),
129 self.assertThat(self.app.main_view.get_year(self.week_view),129 Equals(expected_month_name_year))
130 Equals(expected_year))
131
132 self.assertThat(self.app.main_view.get_month_name(self.week_view),
133 Equals(expected_month_name))
134130
135 def test_current_week_is_selected(self):131 def test_current_week_is_selected(self):
136 """By default, the week view shows the current week."""132 """By default, the week view shows the current week."""

Subscribers

People subscribed via source and target branches

to status/vote changes: