Merge lp:~pkunal-parmar/ubuntu-calendar-app/YearView-Resize into lp:ubuntu-calendar-app

Proposed by Kunal Parmar
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 196
Merged at revision: 196
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/YearView-Resize
Merge into: lp:ubuntu-calendar-app
Diff against target: 19 lines (+4/-2)
1 file modified
YearView.qml (+4/-2)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/YearView-Resize
Reviewer Review Type Date Requested Status
Olivier Tilloy (community) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+204681@code.launchpad.net

Commit message

YearView resize handled, now according to width of YearView, it will show 2,3 or 4 month in row

Description of the change

YearView resize handled, now according to width of YearView, it will show 2,3 or 4 month in row

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: Needs Fixing (continuous-integration)
194. By Kunal Parmar

Trailing whitespace removed

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
Olivier Tilloy (osomon) wrote :

This can be re-written in a much more compact way (and hopefully be optimized away by the JS engine):

    readonly property int minCellWidth: units.gu(30)
    cellWidth: Math.floor(Math.min.apply(Math, [3, 4].map(function(n) { return ((width / n >= minCellWidth) ? width / n : width / 2) })))

195. By Kunal Parmar

Review comment

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
196. By Kunal Parmar

merge from trunk

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
Olivier Tilloy (osomon) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'YearView.qml'
2--- YearView.qml 2014-01-09 23:15:57 +0000
3+++ YearView.qml 2014-02-10 14:25:37 +0000
4@@ -51,11 +51,13 @@
5 height: parent.height
6 anchors.top: parent.top
7
8- cellWidth: width/2
9+ readonly property int minCellWidth: units.gu(30)
10+ cellWidth: Math.floor(Math.min.apply(Math, [3, 4].map(function(n)
11+ { return ((width / n >= minCellWidth) ? width / n : width / 2) })))
12+
13 cellHeight: cellWidth * 1.4
14
15 model: 12 /* months in a year */
16- snapMode: GridView.SnapOneRow
17 delegate: Item {
18 width: yearView.cellWidth
19 height: yearView.cellHeight

Subscribers

People subscribed via source and target branches

to status/vote changes: