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
=== modified file 'src/app/qml/components/EditTagsDialog.qml'
--- src/app/qml/components/EditTagsDialog.qml 2015-09-21 16:32:10 +0000
+++ src/app/qml/components/EditTagsDialog.qml 2016-04-30 16:58:43 +0000
@@ -33,7 +33,6 @@
33 property string haveTagsText: i18n.tr("Enter a tag name or select one from the list to attach it to the note.")33 property string haveTagsText: i18n.tr("Enter a tag name or select one from the list to attach it to the note.")
3434
35 property var note35 property var note
36 property int pageHeight
3736
38 signal done();37 signal done();
3938
@@ -66,7 +65,12 @@
6665
67 function accept() {66 function accept() {
68 var tagName = displayText;67 var tagName = displayText;
69 text = '';68 // While displayText might be something useful, text will be empty when typing with
69 // predictive keyboard. displayText is read-only though, in order to update it, we
70 // need to actually cause a changed event on text, so let's set it and unset it again.
71 textField.text = ' ';
72 textField.text = '';
73
7074
71 // Check if the tag exists75 // Check if the tag exists
72 for (var i=0; i < tags.count; i++) {76 for (var i=0; i < tags.count; i++) {
@@ -146,25 +150,33 @@
146 }150 }
147 }151 }
148152
149 OptionSelector {153 Column {
150 id: optionSelector154 width: parent.width
151155
152 Layout.preferredWidth: parent.width - units.gu(2)156 Repeater {
153 Layout.alignment: Qt.AlignHCenter157 id: optionSelector
154158
155 currentlyExpanded: true159 model: tags
156 multiSelection: true160
157161 ListItem {
158 containerHeight: Math.min(root.pageHeight / 3, tags.count * itemHeight)162 id: tagDelegate
159163 height: units.gu(5)
160 model: tags164 property bool selected: root.note ? root.note.tagGuids.indexOf(model.guid) !== -1 : false
161165
162 delegate: OptionSelectorDelegate {166 SlotsLayout {
163 text: model.name167 height: units.gu(5)
164 selected: root.note ? root.note.tagGuids.indexOf(model.guid) !== -1 : false168 mainSlot: Label {
165169 text: model.name
166 MouseArea {170 }
167 anchors.fill: parent171
172 Icon {
173 name: "tick"
174 height: units.gu(3)
175 width: height
176 visible: tagDelegate.selected
177 SlotsLayout.position: SlotsLayout.Trailing
178 }
179 }
168180
169 onClicked: {181 onClicked: {
170 if (selected) {182 if (selected) {
171183
=== modified file 'src/app/qml/ui/EditNoteView.qml'
--- src/app/qml/ui/EditNoteView.qml 2016-04-29 08:30:47 +0000
+++ src/app/qml/ui/EditNoteView.qml 2016-04-30 16:58:43 +0000
@@ -162,7 +162,7 @@
162 pageStack.push(Qt.resolvedUrl("SetReminderPage.qml"), { note: root.note});162 pageStack.push(Qt.resolvedUrl("SetReminderPage.qml"), { note: root.note});
163 }163 }
164 onEditTags: {164 onEditTags: {
165 PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root, { note: root.note, pageHeight: root.height});165 PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root, { note: root.note });
166 }166 }
167 }167 }
168168
169169
=== modified file 'src/app/qml/ui/NoteView.qml'
--- src/app/qml/ui/NoteView.qml 2015-09-15 14:50:55 +0000
+++ src/app/qml/ui/NoteView.qml 2016-04-30 16:58:43 +0000
@@ -69,7 +69,7 @@
69 pagestack.push(Qt.resolvedUrl("SetReminderPage.qml"), { note: root.note});69 pagestack.push(Qt.resolvedUrl("SetReminderPage.qml"), { note: root.note});
70 }70 }
71 onEditTags: {71 onEditTags: {
72 PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root, { note: root.note, pageHeight: root.height });72 PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root, { note: root.note });
73 }73 }
74 }74 }
75 }75 }
7676
=== modified file 'src/app/qml/ui/NotesPage.qml'
--- src/app/qml/ui/NotesPage.qml 2015-11-02 20:26:37 +0000
+++ src/app/qml/ui/NotesPage.qml 2016-04-30 16:58:43 +0000
@@ -201,7 +201,7 @@
201 }201 }
202 onEditTags: {202 onEditTags: {
203 var popup = PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root,203 var popup = PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root,
204 { note: NotesStore.note(model.guid), pageHeight: root.height });204 { note: NotesStore.note(model.guid) });
205 popup.done.connect(function() { NotesStore.saveNote(popup.note.guid)})205 popup.done.connect(function() { NotesStore.saveNote(popup.note.guid)})
206 }206 }
207 }207 }
208208
=== modified file 'src/app/qml/ui/SearchNotesPage.qml'
--- src/app/qml/ui/SearchNotesPage.qml 2015-09-15 14:50:55 +0000
+++ src/app/qml/ui/SearchNotesPage.qml 2016-04-30 16:58:43 +0000
@@ -114,7 +114,7 @@
114 }114 }
115 onEditTags: {115 onEditTags: {
116 var popup = PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root,116 var popup = PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root,
117 { note: NotesStore.note(model.guid), pageHeight: root.height });117 { note: NotesStore.note(model.guid) });
118 popup.done.connect(function() { NotesStore.saveNote(popup.note.guid)})118 popup.done.connect(function() { NotesStore.saveNote(popup.note.guid)})
119 }119 }
120 }120 }

Subscribers

People subscribed via source and target branches