Merge lp:~rpadovani/reminders-app/1379886 into lp:reminders-app

Proposed by Riccardo Padovani
Status: Merged
Approved by: David Planella
Approved revision: 279
Merged at revision: 281
Proposed branch: lp:~rpadovani/reminders-app/1379886
Merge into: lp:reminders-app
Diff against target: 113 lines (+53/-49)
1 file modified
src/app/qml/ui/RemindersPage.qml (+53/-49)
To merge this branch: bzr merge lp:~rpadovani/reminders-app/1379886
Reviewer Review Type Date Requested Status
David Planella Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+238409@code.launchpad.net

Commit message

Fix #1379886 - First time reminders tab is shown, the list is offset from the top

Description of the change

Fix #1379886 - First time reminders tab is shown, the list is offset from the top

I'm not sure what are roots of the bug, I think is because ListView height is set before all delegates are istanciated. So I inserted the listview in an Item that fills the parent, and set anchor of listview to Item

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
David Planella (dpm) wrote :

LGTM, thanks!

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/RemindersPage.qml'
2--- src/app/qml/ui/RemindersPage.qml 2014-09-23 12:39:27 +0000
3+++ src/app/qml/ui/RemindersPage.qml 2014-10-15 10:31:22 +0000
4@@ -56,56 +56,60 @@
5 onlyReminders: true
6 }
7
8- ListView {
9- id: remindersListView
10+ Item {
11 anchors.fill: parent
12-
13- delegate: RemindersDelegate {
14- width: remindersListView.width
15- note: notes.note(guid)
16-
17- Component.onCompleted: {
18- if (!model.plaintextContent) {
19- NotesStore.refreshNoteContent(model.guid)
20- }
21- }
22-
23- onClicked: {
24- root.selectedNote = NotesStore.note(guid);
25- }
26- }
27-
28- model: notes
29-
30- section.criteria: ViewSection.FullString
31- section.property: "reminderTimeString"
32- section.delegate: Empty {
33- height: units.gu(5)
34- RowLayout {
35- anchors { left: parent.left; right: parent.right; verticalCenter: parent.verticalCenter; margins: units.gu(2) }
36- Label {
37- text: section
38- Layout.fillWidth: true
39- }
40- Label {
41- text: "(" + notes.sectionCount("reminderTimeString", section) + ")"
42- }
43- }
44- }
45-
46- ActivityIndicator {
47- anchors.centerIn: parent
48- running: notes.loading
49- visible: running
50- }
51- Label {
52- anchors.centerIn: parent
53- visible: !notes.loading && (notes.error || remindersListView.count == 0)
54- width: parent.width - units.gu(4)
55- wrapMode: Text.WordWrap
56- horizontalAlignment: Text.AlignHCenter
57- text: notes.error ? notes.error :
58- i18n.tr("No reminders available. You can create new reminders by setting a reminder when viewing a note.")
59+ ListView {
60+ id: remindersListView
61+ anchors { left: parent.left; right: parent.right }
62+ height: parent.height - y
63+
64+ delegate: RemindersDelegate {
65+ width: remindersListView.width
66+ note: notes.note(guid)
67+
68+ Component.onCompleted: {
69+ if (!model.plaintextContent) {
70+ NotesStore.refreshNoteContent(model.guid)
71+ }
72+ }
73+
74+ onClicked: {
75+ root.selectedNote = NotesStore.note(guid);
76+ }
77+ }
78+
79+ model: notes
80+
81+ section.criteria: ViewSection.FullString
82+ section.property: "reminderTimeString"
83+ section.delegate: Empty {
84+ height: units.gu(5)
85+ RowLayout {
86+ anchors { left: parent.left; right: parent.right; verticalCenter: parent.verticalCenter; margins: units.gu(2) }
87+ Label {
88+ text: section
89+ Layout.fillWidth: true
90+ }
91+ Label {
92+ text: "(" + notes.sectionCount("reminderTimeString", section) + ")"
93+ }
94+ }
95+ }
96+
97+ ActivityIndicator {
98+ anchors.centerIn: parent
99+ running: notes.loading
100+ visible: running
101+ }
102+ Label {
103+ anchors.centerIn: parent
104+ visible: !notes.loading && (notes.error || remindersListView.count == 0)
105+ width: parent.width - units.gu(4)
106+ wrapMode: Text.WordWrap
107+ horizontalAlignment: Text.AlignHCenter
108+ text: notes.error ? notes.error :
109+ i18n.tr("No reminders available. You can create new reminders by setting a reminder when viewing a note.")
110+ }
111 }
112 }
113 }

Subscribers

People subscribed via source and target branches