Michael Zanetti has proposed merging
lp:~mzanetti/reminders-app/improve-tags-dialog into lp:reminders-app.
Commit message:
Improve tags dialog
Requested reviews:
Jenkins Bot (ubuntu-core-apps-jenkins-bot): continuous-integration
Ubuntu Notes app developers (notes-app-dev)
Related bugs:
Bug #1478094 in Ubuntu Notes app: "Tags wil not allow you to tap okay until
the word is released from the keyboard"
https://bugs.launchpad.net/reminders-app/+bug/1478094
For more details, see:
https://code.launchpad.net/~mzanetti/reminders-app/improve-tags-dialog/+merge/293466
--
Your team Ubuntu Notes app developers is requested to review the proposed merge
of lp:~mzanetti/reminders-app/improve-tags-dialog into lp:reminders-app.
=== modified file 'src/app/qml/components/EditTagsDialog.qml'
--- src/app/qml/components/EditTagsDialog.qml 2015-09-21 16:32:10 +
+++ src/app/qml/components/EditTagsDialog.qml 2016-04-30 16:58:43 +
@@ -33,7 +33,6 @@
property string haveTagsText: i18n.tr("Enter a tag name or select one from the list to attach it to the note.")
property var note
-property int pageHeight
signal done();
@@ -66,7 +65,12 @@
function accept() {
var tagName = displayText;
-text = '';
+// While displayText might be something useful, text will be empty when typing with
+// predictive keyboard. displayText is read-only though, in order to update it, we
+// need to actually cause a changed event on text, so let's set it and unset it again.
+textField.text = ' ';
+textField.text = '';
+
// Check if the tag exists
for (var i=0; i < tags.count; i++) {
@@ -146,25 +150,33 @@
}
}
-OptionSelector {
-id: optionSelector
-
-Layout.preferredWidth: parent.width - units.gu(2)
-Layout.alignment: Qt.AlignHCenter
-
-currentlyExpanded: true
-multiSelection: true
-
-containerHeight: Math.min(root.pageHeight / 3, tags.count * itemHeight)
-
-model: tags
-
-delegate: OptionSelectorDelegate {
-text: model.name
-selected: root.note ? root.note.tagGuids.indexOf(model.guid) !== -1 : false
-
-MouseArea {
-anchors.fill: parent
+Column {
+width: parent.width
+
+Repeater {
+id: optionSelector
+
+model: tags
+
+ListItem {
+id: tagDelegate
+height: units.gu(5)
+property bool selected: root.note ? root.note.tagGuids.indexOf(model.guid) !== -1 : false
+
+SlotsLayout {
+height: units.gu(5)
+mainSlot: Label {
+text: model.name
+}
+
+Icon {
+name: "tick"
+height: units.gu(3)
+width: height
+visible: tagDelegate.selected
+SlotsLayout.position: SlotsLayout.Trailing
+}
+}
onClicked: {
if (selected) {
=== modified file 'src/app/qml/ui/EditNoteView.qml'
--- src/app/qml/ui/EditNoteView.qml 2016-04-29 08:30:47 +
+++ src/app/qml/ui/EditNoteView.qml 2016-04-30 16:58:43 +
@@ -162,7 +162,7 @@
pageStack.push(Qt.resolvedUrl("SetReminderPage.qml"), { note: root.note});
}
onEditTags: {
-PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root, { note: root.note, pageHeight: root.height});
+PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root, { note: root.note });
}
}
=== modified file 'src/app/qml/ui/NoteView.qml'
--- src/app/qml/ui/NoteView.qml 2015-09-15 14:50:55 +
+++ src/app/qml/ui/NoteView.qml 2016-04-30 16:58:43 +
@@ -69,7 +69,7 @@
pagestack.push(Qt.resolvedUrl("SetReminderPage.qml"), { note: root.note});
}
onEditTags: {
-PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root, { note: root.note, pageHeight: root.height });
+PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root, { note: root.note });
}
}
}
=== modified file 'src/app/qml/ui/NotesPage.qml'
--- src/app/qml/ui/NotesPage.qml 2015-11-02 20:26:37 +
+++ src/app/qml/ui/NotesPage.qml 2016-04-30 16:58:43 +
@@ -201,7 +201,7 @@
}
onEditTags: {
var popup = PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root,
-{ note: NotesStore.note(model.guid),