Merge lp:~pkunal-parmar/ubuntu-calendar-app/yearview_fix into lp:ubuntu-calendar-app
- yearview_fix
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Olivier Tilloy |
Approved revision: | 149 |
Merged at revision: | 150 |
Proposed branch: | lp:~pkunal-parmar/ubuntu-calendar-app/yearview_fix |
Merge into: | lp:ubuntu-calendar-app |
Diff against target: |
173 lines (+44/-64) 3 files modified
MonthComponent.qml (+13/-29) ViewHeader.qml (+4/-2) YearView.qml (+27/-33) |
To merge this branch: | bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/yearview_fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Olivier Tilloy (community) | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Review via email:
|
Commit message
YearView changed to use GridView
MonthComponent is creating hilight only when necessary
Description of the change
YearView changed to use GridView
MonthComponent is creating hilight only when necessary
- 140. By Kunal Parmar
-
newlines removed
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
- 141. By Kunal Parmar
-
reused view header
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:141
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Olivier Tilloy (osomon) wrote : | # |
When I click on any month in the year view, I’m getting the following error:
YearView.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Olivier Tilloy (osomon) wrote : | # |
52 + property bool shouldCreateHig
53 + property var hightlightObj;
54 +
55 + onShouldCreateH
56 + if( shouldCreateHig
57 + hightlightObj = highLightComp.
58 + hightlightObj.z = hightlightObj.z -1;
59 + } else {
60 + if( hightlightObj) {
61 + hightlightObj.
62 + }
63 + }
Please use a Loader element instead of manually instantiating/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Olivier Tilloy (osomon) wrote : | # |
128 + flow: Grid.LeftToRight
Grid.LeftToRight is the default value, so this is useless.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Olivier Tilloy (osomon) wrote : | # |
169 + model: 6/*rows*/ * 2 /*columns*/
or, simpler:
model: 12 /* months in a year */
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Olivier Tilloy (osomon) wrote : | # |
178 + width: parent.width - units.gu(1)
179 + height: parent.height - units.gu(1)
180 + anchors.centerIn: parent
Better to use "anchors.fill: parent" and "anchors.margins: units.gu(0.5)" in that case.
- 142. By Kunal Parmar
-
monthDate is not defined fixed
- 143. By Kunal Parmar
-
flow: Grid.LeftToRight
- 144. By Kunal Parmar
-
model: 12 /* months in a year */
- 145. By Kunal Parmar
-
layouting fixed for monthComponent
- 146. By Kunal Parmar
-
Loader used instead of manual creation of object
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kunal Parmar (pkunal-parmar) wrote : | # |
Thanks, I addressed your comments, Pls have a look again.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Olivier Tilloy (osomon) wrote : | # |
> Thanks, I addressed your comments, Pls have a look again.
Looks like you forgot to push your changes to the branch, I’m not seeing any updates.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kunal Parmar (pkunal-parmar) wrote : | # |
> > Thanks, I addressed your comments, Pls have a look again.
>
> Looks like you forgot to push your changes to the branch, I’m not seeing any
> updates.
Someting is wrong with bzr, when I use bzr push, it it pushing changes to different branch.
But now this branch should have my recent changes. Thanks..
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kunal Parmar (pkunal-parmar) wrote : | # |
BTW, can you check out this MR as well
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:146
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Olivier Tilloy (osomon) wrote : | # |
> Someting is wrong with bzr, when I use bzr push, it it pushing changes to
> different branch.
If you issue `bzr info`, it will show where it will push by default. You can change the default push location with `bzr push --remember $LOCATION`
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Olivier Tilloy (osomon) wrote : | # |
46 + property bool shouldCreateHig
47 +
48 + onShouldCreateH
49 + if( shouldCreateHig
50 + highlightLoader
51 + } else {
52 + //unloading the highlight
53 + highlightLoader
54 + }
55 + }
This is better, but it can be taken one step further to make it fully declarative: remove entirely the shouldCreateHig
Loader {
[…]
}
(and you can then remove the 'highlightLoader' id which will be unused).
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Olivier Tilloy (osomon) wrote : | # |
78 + id: highLightRect
Please also remove this id which is unused.
- 147. By Kunal Parmar
-
id: highLightRect removed
- 148. By Kunal Parmar
-
using declarative way to load a loader
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kunal Parmar (pkunal-parmar) wrote : | # |
> > Someting is wrong with bzr, when I use bzr push, it it pushing changes to
> > different branch.
>
> If you issue `bzr info`, it will show where it will push by default. You can
> change the default push location with `bzr push --remember $LOCATION`
Thanks, this helped
- 149. By Kunal Parmar
-
merge from trunk
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kunal Parmar (pkunal-parmar) wrote : | # |
> 46 + property bool shouldCreateHig
> date.isSameDay(
> 47 +
> 48 + onShouldCreateH
> 49 + if( shouldCreateHig
> 50 + highlightLoader
> 51 + } else {
> 52 + //unloading the highlight
> 53 + highlightLoader
> 54 + }
> 55 + }
>
> This is better, but it can be taken one step further to make it fully
> declarative: remove entirely the shouldCreateHig
>
Done, please have another look
> Loader {
> sourceComponent: date.isSameDay(
> highLightComp : undefined
> […]
> }
>
> (and you can then remove the 'highlightLoader' id which will be unused).
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:149
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Olivier Tilloy (osomon) wrote : | # |
Looks good now, thanks!
Preview Diff
1 | === modified file 'MonthComponent.qml' | |||
2 | --- MonthComponent.qml 2013-09-04 13:37:10 +0000 | |||
3 | +++ MonthComponent.qml 2013-10-09 23:35:38 +0000 | |||
4 | @@ -35,30 +35,11 @@ | |||
5 | 35 | anchors.fill: parent | 35 | anchors.fill: parent |
6 | 36 | spacing: units.gu(1.5) | 36 | spacing: units.gu(1.5) |
7 | 37 | 37 | ||
9 | 38 | Item{ | 38 | ViewHeader{ |
10 | 39 | id: monthHeader | 39 | id: monthHeader |
33 | 40 | width: parent.width | 40 | date: root.monthDate |
34 | 41 | height: monthLabel.height | 41 | monthLabelFontSize: root.monthLabelFontSize |
35 | 42 | 42 | yearLabelFontSize: root.yearLabelFontSize | |
14 | 43 | Label{ | ||
15 | 44 | id: monthLabel | ||
16 | 45 | fontSize: monthLabelFontSize | ||
17 | 46 | text: Qt.locale().standaloneMonthName(root.monthDate.getMonth()) | ||
18 | 47 | anchors.leftMargin: units.gu(1) | ||
19 | 48 | anchors.left: parent.left | ||
20 | 49 | //color:"white" | ||
21 | 50 | anchors.verticalCenter: parent.verticalCenter | ||
22 | 51 | } | ||
23 | 52 | |||
24 | 53 | Label{ | ||
25 | 54 | id: yearLabel | ||
26 | 55 | fontSize: yearLabelFontSize | ||
27 | 56 | text: root.monthDate.getFullYear() | ||
28 | 57 | anchors.right: parent.right | ||
29 | 58 | anchors.rightMargin: units.gu(1) | ||
30 | 59 | color:"#AEA79F" | ||
31 | 60 | anchors.verticalCenter: parent.verticalCenter | ||
32 | 61 | } | ||
36 | 62 | } | 43 | } |
37 | 63 | 44 | ||
38 | 64 | Row{ | 45 | Row{ |
39 | @@ -106,15 +87,11 @@ | |||
40 | 106 | width: parent.width / 7; | 87 | width: parent.width / 7; |
41 | 107 | height: parent.height / parent.weekCount | 88 | height: parent.height / parent.weekCount |
42 | 108 | 89 | ||
46 | 109 | UbuntuShape{ | 90 | Loader { |
44 | 110 | id: highLightRect | ||
45 | 111 | |||
47 | 112 | width: parent.width | 91 | width: parent.width |
48 | 113 | height: width | 92 | height: width |
49 | 114 | anchors.centerIn: parent | 93 | anchors.centerIn: parent |
53 | 115 | 94 | sourceComponent: date.isSameDay(DateExt.today()) && isCurrentMonth ? highLightComp : undefined | |
51 | 116 | color: "white" | ||
52 | 117 | visible: date.isSameDay(DateExt.today()) && isCurrentMonth | ||
54 | 118 | } | 95 | } |
55 | 119 | 96 | ||
56 | 120 | Label{ | 97 | Label{ |
57 | @@ -156,4 +133,11 @@ | |||
58 | 156 | color: "#AEA79F" | 133 | color: "#AEA79F" |
59 | 157 | } | 134 | } |
60 | 158 | } | 135 | } |
61 | 136 | |||
62 | 137 | Component{ | ||
63 | 138 | id: highLightComp | ||
64 | 139 | UbuntuShape{ | ||
65 | 140 | color: "white" | ||
66 | 141 | } | ||
67 | 142 | } | ||
68 | 159 | } | 143 | } |
69 | 160 | 144 | ||
70 | === modified file 'ViewHeader.qml' | |||
71 | --- ViewHeader.qml 2013-09-16 14:04:37 +0000 | |||
72 | +++ ViewHeader.qml 2013-10-09 23:35:38 +0000 | |||
73 | @@ -7,10 +7,12 @@ | |||
74 | 7 | height: monthLabel.height | 7 | height: monthLabel.height |
75 | 8 | 8 | ||
76 | 9 | property var date; | 9 | property var date; |
77 | 10 | property string monthLabelFontSize: "x-large" | ||
78 | 11 | property string yearLabelFontSize: "large" | ||
79 | 10 | 12 | ||
80 | 11 | Label{ | 13 | Label{ |
81 | 12 | id: monthLabel | 14 | id: monthLabel |
83 | 13 | fontSize: "large" | 15 | fontSize: monthLabelFontSize |
84 | 14 | text: Qt.locale().standaloneMonthName(date.getMonth()) | 16 | text: Qt.locale().standaloneMonthName(date.getMonth()) |
85 | 15 | anchors.leftMargin: units.gu(1) | 17 | anchors.leftMargin: units.gu(1) |
86 | 16 | anchors.left: parent.left | 18 | anchors.left: parent.left |
87 | @@ -20,7 +22,7 @@ | |||
88 | 20 | 22 | ||
89 | 21 | Label{ | 23 | Label{ |
90 | 22 | id: yearLabel | 24 | id: yearLabel |
92 | 23 | fontSize: "medium" | 25 | fontSize: yearLabelFontSize |
93 | 24 | text: date.getFullYear() | 26 | text: date.getFullYear() |
94 | 25 | anchors.right: parent.right | 27 | anchors.right: parent.right |
95 | 26 | anchors.rightMargin: units.gu(1) | 28 | anchors.rightMargin: units.gu(1) |
96 | 27 | 29 | ||
97 | === modified file 'YearView.qml' | |||
98 | --- YearView.qml 2013-09-16 14:04:01 +0000 | |||
99 | +++ YearView.qml 2013-10-09 23:35:38 +0000 | |||
100 | @@ -29,7 +29,7 @@ | |||
101 | 29 | property var startYear: getDateFromYear(currentYear.getFullYear()-1); | 29 | property var startYear: getDateFromYear(currentYear.getFullYear()-1); |
102 | 30 | } | 30 | } |
103 | 31 | 31 | ||
105 | 32 | delegate: Flickable{ | 32 | delegate: GridView{ |
106 | 33 | id: yearView | 33 | id: yearView |
107 | 34 | clip: true | 34 | clip: true |
108 | 35 | 35 | ||
109 | @@ -48,38 +48,32 @@ | |||
110 | 48 | 48 | ||
111 | 49 | width: parent.width | 49 | width: parent.width |
112 | 50 | height: parent.height | 50 | height: parent.height |
145 | 51 | 51 | anchors.top: parent.top | |
146 | 52 | contentHeight: yearGrid.height + units.gu(2) | 52 | |
147 | 53 | contentWidth: width | 53 | cellWidth: width/2 |
148 | 54 | 54 | cellHeight: cellWidth * 1.2 | |
149 | 55 | Grid{ | 55 | |
150 | 56 | id: yearGrid | 56 | model: 12 /* months in a year */ |
151 | 57 | rows: 6 | 57 | snapMode: GridView.SnapOneRow |
152 | 58 | columns: 2 | 58 | delegate: Item { |
153 | 59 | 59 | width: yearView.cellWidth | |
154 | 60 | anchors.top: parent.top | 60 | height: yearView.cellHeight |
155 | 61 | anchors.topMargin: units.gu(1.5) | 61 | |
156 | 62 | 62 | MonthComponent{ | |
157 | 63 | width: parent.width - ((columns-1) * yearGrid.spacing) | 63 | id: monthComponent |
158 | 64 | spacing: units.gu(2) | 64 | monthDate: new Date(yearView.year.getFullYear(),index,1,0,0,0,0) |
159 | 65 | anchors.horizontalCenter: parent.horizontalCenter | 65 | anchors.fill: parent |
160 | 66 | 66 | anchors.margins: units.gu(0.5) | |
161 | 67 | Repeater{ | 67 | |
162 | 68 | model: yearGrid.rows * yearGrid.columns | 68 | dayLabelFontSize:"x-small" |
163 | 69 | delegate: MonthComponent{ | 69 | dateLabelFontSize: "medium" |
164 | 70 | monthDate: new Date(yearView.year.getFullYear(),index,1,0,0,0,0) | 70 | monthLabelFontSize: "medium" |
165 | 71 | width: (parent.width - units.gu(2))/2 | 71 | yearLabelFontSize: "small" |
166 | 72 | height: width * 1.5 | 72 | |
167 | 73 | dayLabelFontSize:"x-small" | 73 | MouseArea{ |
168 | 74 | dateLabelFontSize: "medium" | 74 | anchors.fill: parent |
169 | 75 | monthLabelFontSize: "medium" | 75 | onClicked: { |
170 | 76 | yearLabelFontSize: "small" | 76 | root.monthSelected(monthComponent.monthDate); |
139 | 77 | |||
140 | 78 | MouseArea{ | ||
141 | 79 | anchors.fill: parent | ||
142 | 80 | onClicked: { | ||
143 | 81 | root.monthSelected(monthDate); | ||
144 | 82 | } | ||
171 | 83 | } | 77 | } |
172 | 84 | } | 78 | } |
173 | 85 | } | 79 | } |
PASSED: Continuous integration, rev:140 91.189. 93.70:8080/ job/ubuntu- calendar- app-ci/ 127/ 91.189. 93.70:8080/ job/generic- mediumtests/ 832 91.189. 93.70:8080/ job/ubuntu- calendar- app-precise- amd64-ci/ 127 91.189. 93.70:8080/ job/ubuntu- calendar- app-quantal- amd64-ci/ 127 91.189. 93.70:8080/ job/ubuntu- calendar- app-raring- amd64-ci/ 127 91.189. 93.70:8080/ job/ubuntu- calendar- app-saucy- amd64-ci/ 127
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- calendar- app-ci/ 127/rebuild
http://