Merge lp:~mzanetti/reminders-app/improve-tags-dialog into lp:reminders-app

Proposed by Michael Zanetti
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 πŸ¦„
Approved revision: 553
Merged at revision: 556
Proposed branch: lp:~mzanetti/reminders-app/improve-tags-dialog
Merge into: lp:reminders-app
Diff against target: 130 lines (+37/-25)
5 files modified
src/app/qml/components/EditTagsDialog.qml (+33/-21)
src/app/qml/ui/EditNoteView.qml (+1/-1)
src/app/qml/ui/NoteView.qml (+1/-1)
src/app/qml/ui/NotesPage.qml (+1/-1)
src/app/qml/ui/SearchNotesPage.qml (+1/-1)
To merge this branch: bzr merge lp:~mzanetti/reminders-app/improve-tags-dialog
Reviewer Review Type Date Requested Status
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
Jenkins Bot continuous-integration Approve
Review via email: mp+293466@code.launchpad.net

Commit message

Improve tags dialog

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Much better, 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/components/EditTagsDialog.qml'
2--- src/app/qml/components/EditTagsDialog.qml 2015-09-21 16:32:10 +0000
3+++ src/app/qml/components/EditTagsDialog.qml 2016-04-30 16:58:43 +0000
4@@ -33,7 +33,6 @@
5 property string haveTagsText: i18n.tr("Enter a tag name or select one from the list to attach it to the note.")
6
7 property var note
8- property int pageHeight
9
10 signal done();
11
12@@ -66,7 +65,12 @@
13
14 function accept() {
15 var tagName = displayText;
16- text = '';
17+ // While displayText might be something useful, text will be empty when typing with
18+ // predictive keyboard. displayText is read-only though, in order to update it, we
19+ // need to actually cause a changed event on text, so let's set it and unset it again.
20+ textField.text = ' ';
21+ textField.text = '';
22+
23
24 // Check if the tag exists
25 for (var i=0; i < tags.count; i++) {
26@@ -146,25 +150,33 @@
27 }
28 }
29
30- OptionSelector {
31- id: optionSelector
32-
33- Layout.preferredWidth: parent.width - units.gu(2)
34- Layout.alignment: Qt.AlignHCenter
35-
36- currentlyExpanded: true
37- multiSelection: true
38-
39- containerHeight: Math.min(root.pageHeight / 3, tags.count * itemHeight)
40-
41- model: tags
42-
43- delegate: OptionSelectorDelegate {
44- text: model.name
45- selected: root.note ? root.note.tagGuids.indexOf(model.guid) !== -1 : false
46-
47- MouseArea {
48- anchors.fill: parent
49+ Column {
50+ width: parent.width
51+
52+ Repeater {
53+ id: optionSelector
54+
55+ model: tags
56+
57+ ListItem {
58+ id: tagDelegate
59+ height: units.gu(5)
60+ property bool selected: root.note ? root.note.tagGuids.indexOf(model.guid) !== -1 : false
61+
62+ SlotsLayout {
63+ height: units.gu(5)
64+ mainSlot: Label {
65+ text: model.name
66+ }
67+
68+ Icon {
69+ name: "tick"
70+ height: units.gu(3)
71+ width: height
72+ visible: tagDelegate.selected
73+ SlotsLayout.position: SlotsLayout.Trailing
74+ }
75+ }
76
77 onClicked: {
78 if (selected) {
79
80=== modified file 'src/app/qml/ui/EditNoteView.qml'
81--- src/app/qml/ui/EditNoteView.qml 2016-04-29 08:30:47 +0000
82+++ src/app/qml/ui/EditNoteView.qml 2016-04-30 16:58:43 +0000
83@@ -162,7 +162,7 @@
84 pageStack.push(Qt.resolvedUrl("SetReminderPage.qml"), { note: root.note});
85 }
86 onEditTags: {
87- PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root, { note: root.note, pageHeight: root.height});
88+ PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root, { note: root.note });
89 }
90 }
91
92
93=== modified file 'src/app/qml/ui/NoteView.qml'
94--- src/app/qml/ui/NoteView.qml 2015-09-15 14:50:55 +0000
95+++ src/app/qml/ui/NoteView.qml 2016-04-30 16:58:43 +0000
96@@ -69,7 +69,7 @@
97 pagestack.push(Qt.resolvedUrl("SetReminderPage.qml"), { note: root.note});
98 }
99 onEditTags: {
100- PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root, { note: root.note, pageHeight: root.height });
101+ PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root, { note: root.note });
102 }
103 }
104 }
105
106=== modified file 'src/app/qml/ui/NotesPage.qml'
107--- src/app/qml/ui/NotesPage.qml 2015-11-02 20:26:37 +0000
108+++ src/app/qml/ui/NotesPage.qml 2016-04-30 16:58:43 +0000
109@@ -201,7 +201,7 @@
110 }
111 onEditTags: {
112 var popup = PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root,
113- { note: NotesStore.note(model.guid), pageHeight: root.height });
114+ { note: NotesStore.note(model.guid) });
115 popup.done.connect(function() { NotesStore.saveNote(popup.note.guid)})
116 }
117 }
118
119=== modified file 'src/app/qml/ui/SearchNotesPage.qml'
120--- src/app/qml/ui/SearchNotesPage.qml 2015-09-15 14:50:55 +0000
121+++ src/app/qml/ui/SearchNotesPage.qml 2016-04-30 16:58:43 +0000
122@@ -114,7 +114,7 @@
123 }
124 onEditTags: {
125 var popup = PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root,
126- { note: NotesStore.note(model.guid), pageHeight: root.height });
127+ { note: NotesStore.note(model.guid) });
128 popup.done.connect(function() { NotesStore.saveNote(popup.note.guid)})
129 }
130 }

Subscribers

People subscribed via source and target branches