Merge lp:~ubuntu-calendar-dev/ubuntu-calendar-app/4-Improve-Month-Year-View into lp:ubuntu-calendar-app

Proposed by Mihir Soni
Status: Merged
Approved by: Nekhelesh Ramananthan
Approved revision: 461
Merged at revision: 461
Proposed branch: lp:~ubuntu-calendar-dev/ubuntu-calendar-app/4-Improve-Month-Year-View
Merge into: lp:ubuntu-calendar-app
Diff against target: 303 lines (+107/-100)
3 files modified
MonthComponent.qml (+63/-69)
MonthView.qml (+15/-9)
YearView.qml (+29/-22)
To merge this branch: bzr merge lp:~ubuntu-calendar-dev/ubuntu-calendar-app/4-Improve-Month-Year-View
Reviewer Review Type Date Requested Status
Nekhelesh Ramananthan Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+235302@code.launchpad.net

Commit message

Improved Monthview & Yearview

Description of the change

Improved Monthview & Yearview

To post a comment you must log in.
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
Nekhelesh Ramananthan (nik90) wrote :

lgtm!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'MonthComponent.qml'
2--- MonthComponent.qml 2014-09-08 10:21:19 +0000
3+++ MonthComponent.qml 2014-09-19 15:12:39 +0000
4@@ -40,8 +40,6 @@
5 signal monthSelected(var date);
6 signal dateSelected(var date)
7
8- height: ubuntuShape.height
9-
10 Loader{
11 id: modelLoader
12 sourceComponent: showEvents ? modelComponent: undefined
13@@ -85,8 +83,8 @@
14
15 //check if current month is start month
16 property bool isCurMonthStartMonth: curMonthDate === monthStartDate
17- && curMonth === monthStartMonth
18- && curMonthYear === monthStartYear
19+ && curMonth === monthStartMonth
20+ && curMonthYear === monthStartYear
21
22 //check current month is same as today's month
23 property bool isCurMonthTodayMonth: todayYear === curMonthYear && todayMonth == curMonth
24@@ -94,72 +92,68 @@
25 property int offset: isCurMonthStartMonth ? -1 : (daysInStartMonth - monthStartDate)
26 }
27
28- UbuntuShape {
29- id: ubuntuShape
30-
31- anchors.fill: parent
32- radius: "medium"
33-
34- Column{
35- id: column
36-
37- anchors.top: parent.top
38- anchors.topMargin: units.gu(1.5)
39- anchors.bottomMargin: units.gu(1)
40- anchors.fill: parent
41- spacing: units.gu(1.5)
42-
43- ViewHeader{
44- id: monthHeader
45- month: intern.curMonth
46- year: intern.curMonthYear
47-
48- monthLabelFontSize: root.monthLabelFontSize
49- yearLabelFontSize: root.yearLabelFontSize
50- }
51-
52- Item {
53- width: parent.width
54- height: dayLabelRow.height + units.gu(1)
55-
56- DayHeaderBackground{}
57-
58- Row{
59- id: dayLabelRow
60- width: parent.width
61- anchors.horizontalCenter: parent.horizontalCenter
62- anchors.verticalCenter: parent.verticalCenter
63-
64- Repeater{
65- id: dayLabelRepeater
66- model:7
67- delegate: dafaultDayLabelComponent
68- }
69- }
70- }
71-
72- Grid{
73- id: monthGrid
74- objectName: "monthGrid"
75-
76- property int weekCount : 6
77-
78- width: parent.width
79- height: parent.height - monthGrid.y
80-
81- property int dayWidth: width / 7;
82- property int dayHeight: height / weekCount
83-
84- rows: weekCount
85- columns: 7
86+ Column{
87+ id: column
88+
89+ anchors {
90+ fill: parent
91+ topMargin: units.gu(1.5)
92+ bottomMargin: units.gu(1)
93+ }
94+
95+ spacing: units.gu(1.5)
96+
97+ ViewHeader{
98+ id: monthHeader
99+ month: intern.curMonth
100+ year: intern.curMonthYear
101+
102+ monthLabelFontSize: root.monthLabelFontSize
103+ yearLabelFontSize: root.yearLabelFontSize
104+ visible: isYearView === true
105+ }
106+
107+ Item {
108+ width: parent.width
109+ height: dayLabelRow.height + units.gu(1)
110+
111+ DayHeaderBackground{}
112+
113+ Row{
114+ id: dayLabelRow
115+ width: parent.width
116+ anchors.horizontalCenter: parent.horizontalCenter
117+ anchors.verticalCenter: parent.verticalCenter
118
119 Repeater{
120- id: dateLabelRepeater
121- model: monthGrid.rows * monthGrid.columns
122- delegate: defaultDateLabelComponent
123+ id: dayLabelRepeater
124+ model:7
125+ delegate: dafaultDayLabelComponent
126 }
127 }
128 }
129+
130+ Grid{
131+ id: monthGrid
132+ objectName: "monthGrid"
133+
134+ property int weekCount : 6
135+
136+ width: parent.width
137+ height: parent.height - monthGrid.y
138+
139+ property int dayWidth: width / 7;
140+ property int dayHeight: height / weekCount
141+
142+ rows: weekCount
143+ columns: 7
144+
145+ Repeater{
146+ id: dateLabelRepeater
147+ model: monthGrid.rows * monthGrid.columns
148+ delegate: defaultDateLabelComponent
149+ }
150+ }
151 }
152
153 Component{
154@@ -228,9 +222,9 @@
155
156 Loader{
157 property bool shouldLoad: showEvents
158- && intern.eventStatus !== undefined
159- && intern.eventStatus[index] !== undefined
160- &&intern.eventStatus[index]
161+ && intern.eventStatus !== undefined
162+ && intern.eventStatus[index] !== undefined
163+ &&intern.eventStatus[index]
164 sourceComponent: shouldLoad ? eventIndicatorComp : undefined
165 anchors.top: dateLabel.bottom
166 anchors.horizontalCenter: dateLabel.horizontalCenter
167@@ -280,7 +274,7 @@
168 id: weekDay
169 width: parent.width / 7
170 property var day :Qt.locale().standaloneDayName(( Qt.locale().firstDayOfWeek + index), Locale.ShortFormat)
171- text: day.toUpperCase();
172+ text: day;
173 horizontalAlignment: Text.AlignHCenter
174 fontSize: root.dayLabelFontSize
175 color: "white"
176
177=== modified file 'MonthView.qml'
178--- MonthView.qml 2014-09-19 10:36:39 +0000
179+++ MonthView.qml 2014-09-19 15:12:39 +0000
180@@ -15,7 +15,6 @@
181 * You should have received a copy of the GNU General Public License
182 * along with this program. If not, see <http://www.gnu.org/licenses/>.
183 */
184-
185 import QtQuick 2.3
186 import Ubuntu.Components 1.1
187 import "dateExt.js" as DateExt
188@@ -41,12 +40,19 @@
189 }
190 }
191
192- head.actions: [
193- calendarTodayAction,
194- commonHeaderActions.newEventAction,
195- commonHeaderActions.showCalendarAction,
196- commonHeaderActions.reloadAction
197- ]
198+ head {
199+ actions: [
200+ calendarTodayAction,
201+ commonHeaderActions.newEventAction,
202+ commonHeaderActions.showCalendarAction,
203+ commonHeaderActions.reloadAction
204+ ]
205+
206+ contents: Label {
207+ fontSize: "x-large"
208+ text: i18n.tr(currentMonth.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy")))
209+ }
210+ }
211
212 PathViewBase{
213 id: monthViewPath
214@@ -84,8 +90,8 @@
215
216 showEvents: true
217
218- width: parent.width - units.gu(5)
219- height: parent.height - units.gu(5)
220+ width: parent.width - units.gu(4)
221+ height: parent.height
222
223 currentMonth: monthViewPath.addMonth(monthViewPath.startMonth,
224 monthViewPath.indexType(index));
225
226=== modified file 'YearView.qml'
227--- YearView.qml 2014-09-19 10:36:39 +0000
228+++ YearView.qml 2014-09-19 15:12:39 +0000
229@@ -18,8 +18,8 @@
230
231 import QtQuick 2.3
232 import Ubuntu.Components 1.1
233+
234 import "dateExt.js" as DateExt
235-
236 Page {
237 id: yearViewPage
238 objectName: "yearViewPage"
239@@ -39,12 +39,14 @@
240 }
241 }
242
243- head.actions: [
244- calendarTodayAction,
245- commonHeaderActions.newEventAction,
246- commonHeaderActions.showCalendarAction,
247- commonHeaderActions.reloadAction
248- ]
249+ head {
250+ actions: [
251+ calendarTodayAction,
252+ commonHeaderActions.newEventAction,
253+ commonHeaderActions.showCalendarAction,
254+ commonHeaderActions.reloadAction
255+ ]
256+ }
257
258 PathViewBase {
259 id: yearPathView
260@@ -116,23 +118,28 @@
261 width: yearView.cellWidth
262 height: yearView.cellHeight
263
264- MonthComponent {
265- id: monthComponent
266- objectName: "monthComponent" + index
267- showEvents: false
268- currentMonth: new Date(yearView.year, index, 1, 0, 0, 0, 0)
269-
270- isYearView: true
271+ UbuntuShape {
272 anchors.fill: parent
273 anchors.margins: units.gu(0.5)
274-
275- dayLabelFontSize:"x-small"
276- dateLabelFontSize: "medium"
277- monthLabelFontSize: "medium"
278- yearLabelFontSize: "small"
279-
280- onMonthSelected: {
281- yearViewPage.monthSelected(date);
282+ radius: "medium"
283+
284+ MonthComponent {
285+ id: monthComponent
286+ objectName: "monthComponent" + index
287+ showEvents: false
288+ currentMonth: new Date(yearView.year, index, 1, 0, 0, 0, 0)
289+
290+ isYearView: true
291+ anchors.fill: parent
292+
293+ dayLabelFontSize:"x-small"
294+ dateLabelFontSize: "medium"
295+ monthLabelFontSize: "medium"
296+ yearLabelFontSize: "small"
297+
298+ onMonthSelected: {
299+ yearViewPage.monthSelected(date);
300+ }
301 }
302 }
303 }

Subscribers

People subscribed via source and target branches

to status/vote changes: