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
=== added file 'SimpleDivider.qml'
--- SimpleDivider.qml 1970-01-01 00:00:00 +0000
+++ SimpleDivider.qml 2014-11-26 00:13:59 +0000
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 2013-2014 Canonical Ltd
3 *
4 * This file is part of Ubuntu Calendar App
5 *
6 * Ubuntu Calendar App is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 3 as
8 * published by the Free Software Foundation.
9 *
10 * Ubuntu Calendar App is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * 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/>.
17 */
18
19import QtQuick 2.0
20
21Rectangle{
22 height: units.gu(0.1)
23 width: parent.width
24 color: "#e5e2e2"
25}
026
=== modified file 'TimeLineBackground.qml'
--- TimeLineBackground.qml 2014-10-04 02:19:01 +0000
+++ TimeLineBackground.qml 2014-11-26 00:13:59 +0000
@@ -21,35 +21,13 @@
2121
22Column {22Column {
23 width: parent.width23 width: parent.width
24
25 Repeater {24 Repeater {
26 model: 24 // hour in a day25 model: 24 // hour in a day
2726 delegate: Item {
28 delegate: Rectangle {
29 width: parent.width27 width: parent.width
30 height: units.gu(10)28 height: units.gu(8)
31 color: (index % 2 == 0) ? "#F5F5F5" : "#ECECEC"29
3230 SimpleDivider{}
33 Label {
34 id: timeLabel
35 width: (parent.width / 7) - units.gu(1)
36 wrapMode: Text.WordWrap
37
38 text: {
39 var locale = Qt.locale()
40 return new Date(0, 0, 0, index).toLocaleTimeString
41 (locale, locale.timeFormat(Locale.NarrowFormat))
42 }
43
44 anchors {
45 left: parent.left
46 leftMargin: units.gu(0.5)
47 verticalCenter: parent.verticalCenter
48 }
49
50 color: UbuntuColors.lightGrey
51 fontSize: "small"
52 }
53 }31 }
54 }32 }
55}33}
5634
=== modified file 'TimeLineBase.qml'
--- TimeLineBase.qml 2014-11-08 02:16:45 +0000
+++ TimeLineBase.qml 2014-11-26 00:13:59 +0000
@@ -24,7 +24,7 @@
2424
25 property var delegate;25 property var delegate;
26 property var day;26 property var day;
27 property int hourHeight: units.gu(10)27 property int hourHeight: units.gu(8)
28 property var model;28 property var model;
2929
30 Component.onCompleted: {30 Component.onCompleted: {
3131
=== modified file 'TimeLineBaseComponent.qml'
--- TimeLineBaseComponent.qml 2014-11-08 02:27:16 +0000
+++ TimeLineBaseComponent.qml 2014-11-26 00:13:59 +0000
@@ -43,7 +43,7 @@
43 var currentTime = new Date();43 var currentTime = new Date();
44 scrollHour = currentTime.getHours();44 scrollHour = currentTime.getHours();
4545
46 timeLineView.contentY = scrollHour * units.gu(10);46 timeLineView.contentY = scrollHour * units.gu(8);
47 if(timeLineView.contentY >= timeLineView.contentHeight - timeLineView.height) {47 if(timeLineView.contentY >= timeLineView.contentHeight - timeLineView.height) {
48 timeLineView.contentY = timeLineView.contentHeight - timeLineView.height48 timeLineView.contentY = timeLineView.contentHeight - timeLineView.height
49 }49 }
@@ -61,7 +61,7 @@
6161
62 onScrollDown:{62 onScrollDown:{
63 scrollHour++;63 scrollHour++;
64 var visibleHour = root.height / units.gu(10);64 var visibleHour = root.height / units.gu(8);
65 if( scrollHour > (25 -visibleHour)) {65 if( scrollHour > (25 -visibleHour)) {
66 scrollHour = 25 - visibleHour;66 scrollHour = 25 - visibleHour;
67 }67 }
@@ -70,7 +70,7 @@
70 }70 }
7171
72 function scrollToHour() {72 function scrollToHour() {
73 timeLineView.contentY = scrollHour * units.gu(10);73 timeLineView.contentY = scrollHour * units.gu(8);
74 if(timeLineView.contentY >= timeLineView.contentHeight - timeLineView.height) {74 if(timeLineView.contentY >= timeLineView.contentHeight - timeLineView.height) {
75 timeLineView.contentY = timeLineView.contentHeight - timeLineView.height75 timeLineView.contentY = timeLineView.contentHeight - timeLineView.height
76 }76 }
@@ -108,13 +108,18 @@
108 Flickable {108 Flickable {
109 id: timeLineView109 id: timeLineView
110110
111 contentHeight: units.gu(10) * 24111 contentHeight: units.gu(8) * 24
112 contentWidth: width112 contentWidth: width
113 anchors.fill: parent113 anchors.fill: parent
114114
115 clip: true115 clip: true
116116
117 TimeLineBackground {}117 Row {
118 width: parent.width
119 height: timeLineView.contentHeight
120 TimeLineTimeScale{ id: timeScale }
121 TimeLineBackground { width: parent.width - x}
122 }
118123
119 Row {124 Row {
120 id: week125 id: week
121126
=== added file 'TimeLineTimeScale.qml'
--- TimeLineTimeScale.qml 1970-01-01 00:00:00 +0000
+++ TimeLineTimeScale.qml 2014-11-26 00:13:59 +0000
@@ -0,0 +1,61 @@
1/*
2 * Copyright (C) 2013-2014 Canonical Ltd
3 *
4 * This file is part of Ubuntu Calendar App
5 *
6 * Ubuntu Calendar App is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 3 as
8 * published by the Free Software Foundation.
9 *
10 * Ubuntu Calendar App is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * 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/>.
17 */
18
19import QtQuick 2.0
20import Ubuntu.Components 1.1
21
22Flickable{
23 id: timeFlickble
24
25 height: parent.height
26 width: units.gu(6)
27
28 contentHeight: 24 * units.gu(8)
29 contentWidth: width
30
31 interactive: false
32
33 clip: true
34
35 Column {
36 id: timeLine
37 width: parent.width
38
39 Repeater {
40 model: 24 // hour in a day
41
42 delegate: Item {
43 width: parent.width
44 height: units.gu(8)
45
46 Label {
47 id: timeLabel
48 width: units.gu(5)
49 anchors.top: parent.top
50 anchors.topMargin: units.gu(0.5)
51 horizontalAlignment: Text.AlignRight
52 text: Qt.formatTime( new Date(0,0,0,index), "hh:mm")
53 color: UbuntuColors.lightGrey
54 fontSize: "small"
55 }
56
57 SimpleDivider{}
58 }
59 }
60 }
61}

Subscribers

People subscribed via source and target branches

to status/vote changes: