Merge lp:~mzanetti/reminders-app/improve-section-headers into lp:reminders-app

Proposed by Michael Zanetti
Status: Merged
Approved by: Riccardo Padovani
Approved revision: 358
Merged at revision: 361
Proposed branch: lp:~mzanetti/reminders-app/improve-section-headers
Merge into: lp:reminders-app
Diff against target: 37 lines (+25/-2)
1 file modified
src/app/qml/ui/NotesPage.qml (+25/-2)
To merge this branch: bzr merge lp:~mzanetti/reminders-app/improve-section-headers
Reviewer Review Type Date Requested Status
Riccardo Padovani Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+251349@code.launchpad.net

Commit message

Improve section headers when sorting

Previously section headers were always built on dateCreated. Now they adjust depending on the selected sorting mechanism.

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
Riccardo Padovani (rpadovani) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/qml/ui/NotesPage.qml'
2--- src/app/qml/ui/NotesPage.qml 2015-02-25 22:48:18 +0000
3+++ src/app/qml/ui/NotesPage.qml 2015-02-28 02:15:48 +0000
4@@ -208,8 +208,31 @@
5 }
6 }
7
8- section.criteria: ViewSection.FullString
9- section.property: "createdString"
10+ section.criteria: {
11+ switch (notes.sortOrder) {
12+ case Notes.SortOrderTitleAscending:
13+ case Notes.SortOrderTitleDescending:
14+ return ViewSection.FirstCharacter;
15+ }
16+
17+ return ViewSection.FullString
18+ }
19+ section.property: {
20+ switch(notes.sortOrder) {
21+ case Notes.SortOrderDateCreatedNewest:
22+ case Notes.SortOrderDateCreatedOldest:
23+ return "createdString";
24+ case Notes.SortOrderDateUpdatedNewest:
25+ case Notes.SortOrderDateUpdatedOldest:
26+ return "updatedString";
27+ case Notes.SortOrderTitleAscending:
28+ case Notes.SortOrderTitleDescending:
29+ return "title";
30+ }
31+ return "";
32+ }
33+
34+
35 section.delegate: Empty {
36 height: units.gu(5)
37 showDivider: false

Subscribers

People subscribed via source and target branches