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

Proposed by Riccardo Padovani
Status: Merged
Approved by: Michael Zanetti
Approved revision: 313
Merged at revision: 326
Proposed branch: lp:~rpadovani/reminders-app/tagsUI
Merge into: lp:reminders-app
Diff against target: 623 lines (+322/-136)
8 files modified
src/app/qml/components/EditTagsDialog.qml (+127/-0)
src/app/qml/components/TagsDelegate.qml (+1/-0)
src/app/qml/reminders.qml (+21/-0)
src/app/qml/ui/EditNoteView.qml (+85/-12)
src/app/qml/ui/NotePage.qml (+4/-2)
src/app/qml/ui/NoteView.qml (+40/-3)
src/app/qml/ui/TagsPage.qml (+43/-118)
src/libqtevernote/tags.h (+1/-1)
To merge this branch: bzr merge lp:~rpadovani/reminders-app/tagsUI
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
David Planella Needs Information
Review via email: mp+241177@code.launchpad.net

Commit message

Improved tags UI

Description of the change

Created all interface for tags:
- Improved tags page
- Added list of tags of a note in note view, click on a tag to open the page
- Created a dialog to edit tags of a note (add and remove them)

TODO:
We need an icon for tags button in the toolbox of editNoteView. ATM it uses the bookmark one

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
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

* Please move the tags button further to the left. Should be:
undo | redo | spacer todo attachment | tags | blockformat | charformat

* Open the tags dialog, type something into the textfield, press enter
=> there will be a new empty tag attached to the note instead of the newly created one

* I think it's a bit odd that you need to click "+" in order to remove tags. Don't really have a better idea atm. David, your opinion?

* I'm not convinced yet that its good that clicking a tag pushes a new page onto the stack. Usually things like notes, notebooks, tags and reminders are top level items. I might be wrong though. Let's see what David thinks.

* In phone mode, the tags dialog is missing the OK button. Works fine in tablet mode though.

* Adding many tags still overlaps with the date in the NotesDelegate. I think we should elide the tags label.

I do like the general way this is going a lot though! Nice work!

review: Needs Fixing (testing)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

* please revert the translation changes (merge trunk to not update them any more automagically)

* I still get this one in the debug print:
file:///home/mzanetti/Develop/reviews/build-tagsUI-Desktop-Default/src/app/qml/ui/TagsPage.qml:85:5: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column. Column will not function.

* See 1 inline comment

Nice work! Your coding is definitely improving!

review: Needs Fixing
Revision history for this message
Michael Zanetti (mzanetti) wrote :

needs merging with trunk

review: Needs Fixing
lp:~rpadovani/reminders-app/tagsUI updated
304. By Riccardo Padovani

reverted create-tag-guid branch and implemented better way to add a tag after creation

305. By Riccardo Padovani

Some fixes

306. By Riccardo Padovani

Merged with trunk

307. By Riccardo Padovani

Merged lp:~paolorotolo/reminders-app/tagsIcon

308. By Riccardo Padovani

Fixed typo

309. By Riccardo Padovani

Fixed warning

310. By Riccardo Padovani

Reverted pot changes

311. By Riccardo Padovani

Added semicolon

Revision history for this message
Riccardo Padovani (rpadovani) wrote :

> * Please move the tags button further to the left. Should be:
> undo | redo | spacer todo attachment | tags | blockformat | charformat

Done

> * Open the tags dialog, type something into the textfield, press enter
> => there will be a new empty tag attached to the note instead of the newly
> created one

Fixed

> * I think it's a bit odd that you need to click "+" in order to remove tags.
> Don't really have a better idea atm. David, your opinion?

I agree with you, but I don't have any idea

> * I'm not convinced yet that its good that clicking a tag pushes a new page
> onto the stack. Usually things like notes, notebooks, tags and reminders are
> top level items. I might be wrong though. Let's see what David thinks.

No opinion on this

> * In phone mode, the tags dialog is missing the OK button. Works fine in
> tablet mode though.

Fixed - I forgot to remove this behavior when I switched from a Page to a Dialog

> * Adding many tags still overlaps with the date in the NotesDelegate. I think
> we should elide the tags label.

This is another bug:

> * please revert the translation changes (merge trunk to not update them any
> more automagically)

Done

> * I still get this one in the debug print:
> file:///home/mzanetti/Develop/reviews/build-tagsUI-Desktop-
> Default/src/app/qml/ui/TagsPage.qml:85:5: QML Column: Cannot specify top,
> bottom, verticalCenter, fill or centerIn anchors for items inside Column.
> Column will not function.

Fixed

> * See 1 inline comment

Fixed merging with trunk

I also added Paolo's icon and a "Create tag" button in the dialog

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
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
David Planella (dpm) wrote :

Nice work! A couple of things after testing:

- There should be a "Cancel" button in the Dialog to edit tags. The use case is: I've unclicked tags in the list by mistake, but I don't know which ones were originally on the note and I want to revert to the previous state.
- This is just food for thought: perhaps the tags dialog deserves to have a page? The reason I'm saying this is because if the list of tags is big, there's a lot of scrolling to do in the dialog
- On editing tags, the "+" sign should always be at the beginning of the horizontal list. Otherwise, if the list is longer than the horizontal space, you never get to see the "+"
- Food for thought: perhaps we need an "Edit" button instead of "+", to indicate that it opens a dialog to edit (add/remove) tags, instead of just one to add tags.
- It'd be nice if the list of tags would be scrollable and wouldn't just cut off at the right margin. Perhaps it could be an idea to ellipsize and add an arrow (chevron) on the right instead.
- Probably to address on another branch, but I think the tags tab would need some love. This might be a crazy idea, but would it be possible to present a cloud of tags?

review: Needs Fixing
Revision history for this message
David Planella (dpm) wrote :

- What's the criteria for ordering the tags list in the new tag dialog? Most used first?
- Would it be possible to show those which are selected at the top of the list? This would give the user feedback on which one they've just added (so that they don't have to scroll down the list to confirm). Also it would make removing tags easier, so that, again, the user doesn't have to scroll down the list to find the selected tags.

review: Needs Information
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> - There should be a "Cancel" button in the Dialog to edit tags. The use case
> is: I've unclicked tags in the list by mistake, but I don't know which ones
> were originally on the note and I want to revert to the previous state.

I personally despise cancle buttons. If you added a tag by mistake, just remove it again. It's less steps for the user then cancelling and readding the wanted tags.

> - This is just food for thought: perhaps the tags dialog deserves to have a
> page? The reason I'm saying this is because if the list of tags is big,
> there's a lot of scrolling to do in the dialog

I tend to agree that the list can be too long for the dialog... My bad, I told him to use a dialog as Pages are really hard to use because of our tablet layout.

> - Food for thought: perhaps we need an "Edit" button instead of "+", to
> indicate that it opens a dialog to edit (add/remove) tags, instead of just one
> to add tags.

I would suggest to have a red "x" painted next to each tag in edit mode, so you can tap a tag to delete it without opening the dialog.

> - Probably to address on another branch, but I think the tags tab would need
> some love. This might be a crazy idea, but would it be possible to present a
> cloud of tags?

I have some code for that... Did a tag-cloud implementation in another project already at some point.

Revision history for this message
David Planella (dpm) wrote :

On Fri, Nov 14, 2014 at 10:07 AM, Michael Zanetti <
<email address hidden>> wrote:

> > - There should be a "Cancel" button in the Dialog to edit tags. The use
> case
> > is: I've unclicked tags in the list by mistake, but I don't know which
> ones
> > were originally on the note and I want to revert to the previous state.
>
> I personally despise cancle buttons. If you added a tag by mistake, just
> remove it again. It's less steps for the user then cancelling and readding
> the wanted tags.
>

With the current implementation, the issue is that if I have unchecked a
tag by mistake, I need to do a lot of scrolling to check it again, let
alone if I've unchecked multiple ones. In comparison to that, "Cancel" is
just one tap away as a way to undo things.

>
> > - This is just food for thought: perhaps the tags dialog deserves to
> have a
> > page? The reason I'm saying this is because if the list of tags is big,
> > there's a lot of scrolling to do in the dialog
>
> I tend to agree that the list can be too long for the dialog... My bad, I
> told him to use a dialog as Pages are really hard to use because of our
> tablet layout.
>

> > - Food for thought: perhaps we need an "Edit" button instead of "+", to
> > indicate that it opens a dialog to edit (add/remove) tags, instead of
> just one
> > to add tags.
>
> I would suggest to have a red "x" painted next to each tag in edit mode,
> so you can tap a tag to delete it without opening the dialog.
>

+1, but I wouldn't make it red, it looks too much as an error or warning.
Most websites tend to use the same color for the x as the tag's text.

>
> > - Probably to address on another branch, but I think the tags tab would
> need
> > some love. This might be a crazy idea, but would it be possible to
> present a
> > cloud of tags?
>
> I have some code for that... Did a tag-cloud implementation in another
> project already at some point.
>

Cool!

> --
> https://code.launchpad.net/~rpadovani/reminders-app/tagsUI/+merge/241177
> You are reviewing the proposed merge of lp:~rpadovani/reminders-app/tagsUI
> into lp:reminders-app.
>

Revision history for this message
Michael Zanetti (mzanetti) wrote :

> On Fri, Nov 14, 2014 at 10:07 AM, Michael Zanetti <
> <email address hidden>> wrote:
>
> > > - There should be a "Cancel" button in the Dialog to edit tags. The use
> > case
> > > is: I've unclicked tags in the list by mistake, but I don't know which
> > ones
> > > were originally on the note and I want to revert to the previous state.
> >
> > I personally despise cancle buttons. If you added a tag by mistake, just
> > remove it again. It's less steps for the user then cancelling and readding
> > the wanted tags.
> >
>
> With the current implementation, the issue is that if I have unchecked a
> tag by mistake, I need to do a lot of scrolling to check it again, let
> alone if I've unchecked multiple ones. In comparison to that, "Cancel" is
> just one tap away as a way to undo things.

I still believe we should solve the scrolling situation instead of workarounding it :)

How about making it the same as in the Evernote website? Meaning, getting rid of the dialog completely, expanding the + into a TextField for naming the tag and tapping an existing tag would mark it (in our case expand it a little adding the "x". Another tap on the x would remove it. This could then work in both, edit mode and view mode and would solve the "accidental removal" situation.

How does the android app handle tags?

lp:~rpadovani/reminders-app/tagsUI updated
312. By Riccardo Padovani

Improved tags dialog

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 :

I don't reply inline because you did too many comments :D

So, I modified the dialog, so now it is height as the page, it means you can see 10 tags at time, I think it's a number good enough, and we don't need a delete button. Anyway, I think we can discuss about this in today UOS session.

I'm working to scroll the list of tags in the noteview

lp:~rpadovani/reminders-app/tagsUI updated
313. By Riccardo Padovani

Scroll tags in editnoteview and noteview

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
Michael Zanetti (mzanetti) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'src/app/qml/components/EditTagsDialog.qml'
--- src/app/qml/components/EditTagsDialog.qml 1970-01-01 00:00:00 +0000
+++ src/app/qml/components/EditTagsDialog.qml 2014-11-16 01:04:51 +0000
@@ -0,0 +1,127 @@
1/*
2 * Copyright: 2014 Canonical, Ltd
3 *
4 * This file is part of reminders
5 *
6 * reminders is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 3.
9 *
10 * reminders is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import QtQuick 2.3
20import QtQuick.Layouts 1.1
21import Ubuntu.Components 1.1
22import Ubuntu.Components.Popups 1.0
23import Ubuntu.Components.ListItems 1.0
24import Evernote 0.1
25
26Dialog {
27 id: root
28
29 property var note
30 property int pageHeight
31
32 Tags {
33 id: tags
34 }
35
36 RowLayout {
37 Layout.preferredWidth: parent.width - units.gu(2)
38 Layout.alignment: Qt.AlignHCenter
39
40 TextField {
41 id: textField
42 Layout.fillWidth: true
43 placeholderText: i18n.tr("Create a new tag")
44
45 onAccepted: accept();
46
47 function accept() {
48 var tagName = text;
49 text = '';
50
51 // Check if the tag exists
52 for (var i=0; i < tags.count; i++) {
53 var tag = tags.tag(i);
54 if (tag.name == tagName) {
55 // The tag exists, check if is already selected: if it is,
56 // do nothing, otherwise add to tags of the note
57 if (note.tagGuids.indexOf(tag.guid) === -1) {
58 note.tagGuids.push(tag.guid);
59 }
60 return;
61 }
62 }
63
64 NotesStore.createTag(tagName);
65 }
66 }
67
68 Button {
69 text: i18n.tr("Create tag")
70 color: UbuntuColors.orange
71 enabled: textField.text.replace(/\s+/g, '') !== ''; // Not only whitespaces!
72 onClicked: textField.accept()
73 }
74 }
75
76 Connections {
77 target: NotesStore
78 onTagAdded: {
79 note.tagGuids.push(guid);
80 }
81 }
82
83 OptionSelector {
84 id: optionSelector
85
86 Layout.preferredWidth: parent.width - units.gu(2)
87 Layout.alignment: Qt.AlignHCenter
88
89 currentlyExpanded: true
90 multiSelection: true
91
92 containerHeight: Math.min(root.pageHeight - textField.height - closeButton.height - units.gu(12), tags.count * itemHeight)
93
94 model: tags
95
96 delegate: OptionSelectorDelegate {
97 text: model.name
98 selected: root.note ? root.note.tagGuids.indexOf(model.guid) !== -1 : false
99
100 MouseArea {
101 anchors.fill: parent
102
103 onClicked: {
104 if (selected) {
105 var index = root.note.tagGuids.indexOf(model.guid);
106 root.note.tagGuids.splice(index, 1);
107 }
108 else {
109 root.note.tagGuids.push(model.guid);
110 }
111 }
112 }
113 }
114 }
115
116 Button {
117 id: closeButton
118 Layout.preferredWidth: parent.width - units.gu(2)
119 Layout.alignment: Qt.AlignHCenter
120
121 color: UbuntuColors.orange
122
123 text: i18n.tr("Done")
124
125 onClicked: PopupUtils.close(root)
126 }
127}
0128
=== modified file 'src/app/qml/components/TagsDelegate.qml'
--- src/app/qml/components/TagsDelegate.qml 2014-10-09 00:08:52 +0000
+++ src/app/qml/components/TagsDelegate.qml 2014-11-16 01:04:51 +0000
@@ -61,6 +61,7 @@
61 objectName: 'tagTitleLabel'61 objectName: 'tagTitleLabel'
62 text: model.name62 text: model.name
63 fontSize: "large"63 fontSize: "large"
64 Layout.fillWidth: true
6465
65 MouseArea {66 MouseArea {
66 onPressAndHold: {67 onPressAndHold: {
6768
=== modified file 'src/app/qml/reminders.qml'
--- src/app/qml/reminders.qml 2014-11-12 23:48:03 +0000
+++ src/app/qml/reminders.qml 2014-11-16 01:04:51 +0000
@@ -93,9 +93,11 @@
93 var page = component.createObject(root);93 var page = component.createObject(root);
94 page.note = note;94 page.note = note;
95 page.editNote.connect(function(note) {root.switchToEditMode(note)})95 page.editNote.connect(function(note) {root.switchToEditMode(note)})
96 page.openTaggedNotes.connect(function(title, tagGuid) {pagestack.pop();root.openTaggedNotes(title, tagGuid, true)})
96 pagestack.push(page)97 pagestack.push(page)
97 } else {98 } else {
98 var view = sideViewLoader.embed(Qt.resolvedUrl("ui/NoteView.qml"))99 var view = sideViewLoader.embed(Qt.resolvedUrl("ui/NoteView.qml"))
100 view.openTaggedNotes.connect(function(title, tagGuid) {root.openTaggedNotes(title, tagGuid, false)})
99 view.note = note;101 view.note = note;
100 }102 }
101 }103 }
@@ -222,6 +224,25 @@
222 }224 }
223 }225 }
224226
227 function openTaggedNotes(title, tagGuid, narrowMode) {
228 var component = Qt.createComponent(Qt.resolvedUrl("ui/NotesPage.qml"))
229 var page = component.createObject();
230 print("opening note page for tag", tagGuid)
231 pagestack.push(page, {title: title, filterTagGuid: tagGuid, narrowMode: narrowMode});
232 page.selectedNoteChanged.connect(function() {
233 if (page.selectedNote) {
234 root.displayNote(page.selectedNote);
235 if (root.narrowMode) {
236 page.selectedNote = null;
237 }
238 }
239 })
240 page.editNote.connect(function(note) {
241 root.switchToEditMode(note)
242 })
243 NotesStore.refreshNotes();
244 }
245
225 AccountServiceModel {246 AccountServiceModel {
226 id: accounts247 id: accounts
227 applicationId: "com.ubuntu.reminders_reminders"248 applicationId: "com.ubuntu.reminders_reminders"
228249
=== modified file 'src/app/qml/ui/EditNoteView.qml'
--- src/app/qml/ui/EditNoteView.qml 2014-11-13 11:02:14 +0000
+++ src/app/qml/ui/EditNoteView.qml 2014-11-16 01:04:51 +0000
@@ -42,6 +42,21 @@
4242
43 signal exitEditMode(var note)43 signal exitEditMode(var note)
4444
45 function saveNote() {
46 var title = titleTextField.text ? titleTextField.text : i18n.tr("Untitled");
47 var notebookGuid = notebookSelector.selectedGuid;
48 var text = noteTextArea.text;
49
50 if (note) {
51 note.title = titleTextField.text;
52 note.notebookGuid = notebookSelector.selectedGuid;
53 note.richTextContent = noteTextArea.text;
54 NotesStore.saveNote(note.guid);
55 } else {
56 NotesStore.createNote(title, notebookGuid, text);
57 }
58 }
59
45 QtObject {60 QtObject {
46 id: priv61 id: priv
47 property int insertPosition62 property int insertPosition
@@ -105,18 +120,7 @@
105 MouseArea {120 MouseArea {
106 anchors.fill: parent121 anchors.fill: parent
107 onClicked: {122 onClicked: {
108 var title = titleTextField.text ? titleTextField.text : i18n.tr("Untitled");123 saveNote();
109 var notebookGuid = notebookSelector.selectedGuid;
110 var text = noteTextArea.text;
111
112 if (note) {
113 note.title = titleTextField.text
114 note.notebookGuid = notebookSelector.selectedGuid
115 note.richTextContent = noteTextArea.text
116 NotesStore.saveNote(note.guid);
117 } else {
118 NotesStore.createNote(title, notebookGuid, text);
119 }
120 root.exitEditMode(root.note);124 root.exitEditMode(root.note);
121 }125 }
122 }126 }
@@ -369,6 +373,11 @@
369 }373 }
370 }374 }
371375
376 Component {
377 id: tagsDialog
378 EditTagsDialog { note: root.note; pageHeight: parent.height }
379 }
380
372 Rectangle {381 Rectangle {
373 anchors.fill: toolbox382 anchors.fill: toolbox
374 color: "#efefef"383 color: "#efefef"
@@ -383,6 +392,7 @@
383392
384 property bool charFormatExpanded: false393 property bool charFormatExpanded: false
385 property bool blockFormatExpanded: false394 property bool blockFormatExpanded: false
395 property bool tagsRowExpanded: false
386396
387 Behavior on height { UbuntuNumberAnimation {} }397 Behavior on height { UbuntuNumberAnimation {} }
388398
@@ -581,6 +591,57 @@
581 }591 }
582 }592 }
583593
594 Row {
595 anchors { left: parent.left; right: parent.right; rightMargin: units.gu(1) }
596 height: units.gu(4)
597 visible: toolbox.tagsRowExpanded
598 spacing: units.gu(1)
599
600 Rectangle {
601 z: 100
602 color: "#efefef"
603 height: parent.height
604 width: height + units.gu(1)
605 RtfButton {
606 id: editTagsButton
607 iconName: "edit"
608 height: parent.height
609 width: height
610 anchors.horizontalCenter: parent.horizontalCenter
611 onClicked: {
612 PopupUtils.open(tagsDialog)
613 }
614 }
615 }
616
617 ListView {
618 width: parent.width - editTagsButton.width - units.gu(1)
619 height: units.gu(4)
620
621 model: root.note ? root.note.tagGuids.length : undefined
622 orientation: ListView.Horizontal
623 spacing: units.gu(1)
624
625
626 delegate: Rectangle {
627 id: rectangle
628 radius: units.gu(1)
629 color: "white"
630 border.color: preferences.colorForNotebook(root.note.notebookGuid)
631 anchors.verticalCenter: parent.verticalCenter
632 Text {
633 text: NotesStore.tag(root.note.tagGuids[index]).name
634 color: preferences.colorForNotebook(root.note.notebookGuid)
635 Component.onCompleted: {
636 rectangle.width = width + units.gu(2)
637 rectangle.height = height + units.gu(1)
638 anchors.centerIn = parent
639 }
640 }
641 }
642 }
643 }
644
584 RowLayout {645 RowLayout {
585 anchors { left: parent.left; right: parent.right }646 anchors { left: parent.left; right: parent.right }
586 anchors.margins: units.gu(1)647 anchors.margins: units.gu(1)
@@ -648,6 +709,18 @@
648 RtfSeparator {}709 RtfSeparator {}
649710
650 RtfButton {711 RtfButton {
712 iconSource: "../images/tags.svg"
713 height: parent.height
714 width: height
715 active: toolbox.tagsRowExpanded
716 onClicked: {
717 toolbox.tagsRowExpanded = !toolbox.tagsRowExpanded
718 }
719 }
720
721 RtfSeparator {}
722
723 RtfButton {
651 iconName: "navigation-menu"724 iconName: "navigation-menu"
652 height: parent.height725 height: parent.height
653 width: height726 width: height
654727
=== modified file 'src/app/qml/ui/NotePage.qml'
--- src/app/qml/ui/NotePage.qml 2014-09-23 12:39:27 +0000
+++ src/app/qml/ui/NotePage.qml 2014-11-16 01:04:51 +0000
@@ -27,6 +27,7 @@
27 property alias note: noteView.note27 property alias note: noteView.note
2828
29 signal editNote(var note)29 signal editNote(var note)
30 signal openTaggedNotes(string title, string tagGuid)
3031
31 tools: ToolbarItems {32 tools: ToolbarItems {
32 ToolbarButton {33 ToolbarButton {
@@ -68,8 +69,9 @@
68 id: noteView69 id: noteView
69 anchors.fill: parent70 anchors.fill: parent
7071
71 onEditNote: {72 onOpenTaggedNotes: {
72 root.editNote(note) ;73 console.log('babbo natale')
74 root.openTaggedNotes(title, tagGuid);
73 }75 }
74 }76 }
75}77}
7678
=== modified file 'src/app/qml/ui/NoteView.qml'
--- src/app/qml/ui/NoteView.qml 2014-10-10 10:59:00 +0000
+++ src/app/qml/ui/NoteView.qml 2014-11-16 01:04:51 +0000
@@ -27,7 +27,7 @@
27 property string title: note ? note.title : ""27 property string title: note ? note.title : ""
28 property var note: null28 property var note: null
2929
30 signal editNote(var note)30 signal openTaggedNotes(string title, string tagGuid)
3131
32 onNoteChanged: {32 onNoteChanged: {
33 if (root.note != null) {33 if (root.note != null) {
@@ -54,7 +54,8 @@
5454
55 WebView {55 WebView {
56 id: noteTextArea56 id: noteTextArea
57 anchors { fill: parent}57 width: parent.width
58 height: parent.height - tagsRow.height - (tagsRow.height > 0 ? units.gu(2) : 0)
5859
59 property string html: root.note ? note.htmlContent : ""60 property string html: root.note ? note.htmlContent : ""
6061
@@ -89,5 +90,41 @@
89 }90 }
90 }91 }
91 ]92 ]
92 }93 }
94
95 ListView {
96 id: tagsRow
97 anchors { left: parent.left; right: parent.right; bottom: parent.bottom; margins: units.gu(1) }
98 model: root.note ? root.note.tagGuids.length : undefined
99 orientation: ListView.Horizontal
100 spacing: units.gu(1)
101 height: units.gu(3)
102
103 delegate: Rectangle {
104 id: rectangle
105 radius: units.gu(1)
106 color: "white"
107 border.color: preferences.colorForNotebook(root.note.notebookGuid)
108
109 Text {
110 text: NotesStore.tag(root.note.tagGuids[index]).name
111 color: preferences.colorForNotebook(root.note.notebookGuid)
112 Component.onCompleted: {
113 rectangle.width = width + units.gu(2)
114 rectangle.height = height + units.gu(1)
115 anchors.centerIn = parent
116 }
117 }
118
119 MouseArea {
120 anchors.fill: parent
121 onClicked: {
122 if (!narrowMode) {
123 sideViewLoader.clear();
124 }
125 root.openTaggedNotes(NotesStore.tag(root.note.tagGuids[index]).name, NotesStore.tag(root.note.tagGuids[index]).guid)
126 }
127 }
128 }
129 }
93}130}
94131
=== modified file 'src/app/qml/ui/TagsPage.qml'
--- src/app/qml/ui/TagsPage.qml 2014-11-12 23:48:03 +0000
+++ src/app/qml/ui/TagsPage.qml 2014-11-16 01:04:51 +0000
@@ -44,49 +44,39 @@
44 }44 }
45 }45 }
4646
47// tools: ToolbarItems {47 tools: ToolbarItems {
48// ToolbarButton {48 ToolbarButton {
49// action: Action {49 action: Action {
50// objectName: "addNotebookButton"50 text: i18n.tr("Search")
51// text: i18n.tr("Add notebook")51 iconName: "search"
52// iconName: "add"52 onTriggered: {
53// onTriggered: {53 pagestack.push(Qt.resolvedUrl("SearchNotesPage.qml"))
54// contentColumn.newNotebook = true;54 }
55// }55 }
56// }56 }
57// }57
5858 ToolbarButton {
59// ToolbarButton {59 action: Action {
60// action: Action {60 text: i18n.tr("Refresh")
61// text: i18n.tr("Search")61 iconName: "reload"
62// iconName: "search"62 onTriggered: {
63// onTriggered: {63 NotesStore.refreshNotes();
64// pagestack.push(Qt.resolvedUrl("SearchNotesPage.qml"))64 tags.refresh();
65// }65 }
66// }66 }
67// }67 }
6868
69// ToolbarButton {69 ToolbarButton {
70// action: Action {70 action: Action {
71// text: i18n.tr("Refresh")71 text: i18n.tr("Accounts")
72// iconName: "reload"72 iconName: "contacts-app-symbolic"
73// onTriggered: {73 visible: accounts.count > 1
74// NotesStore.refreshNotebooks();74 onTriggered: {
75// }75 openAccountPage(true);
76// }76 }
77// }77 }
7878 }
79// ToolbarButton {79 }
80// action: Action {
81// text: i18n.tr("Accounts")
82// iconName: "contacts-app-symbolic"
83// visible: accounts.count > 1
84// onTriggered: {
85// openAccountPage(true);
86// }
87// }
88// }
89// }
9080
91 Tags {81 Tags {
92 id: tags82 id: tags
@@ -97,45 +87,12 @@
97 anchors.fill: parent87 anchors.fill: parent
98 property bool newNotebook: false88 property bool newNotebook: false
9989
100// states: [
101// State {
102// name: "newNotebook"; when: contentColumn.newNotebook
103// PropertyChanges { target: newNotebookContainer; opacity: 1; height: newNotebookContainer.implicitHeight }
104// PropertyChanges { target: buttonRow; opacity: 1; height: cancelButton.height + units.gu(4) }
105// }
106// ]
107
108// Empty {
109// id: newNotebookContainer
110// height: 0
111// visible: opacity > 0
112// opacity: 0
113// clip: true
114
115// Behavior on height {
116// UbuntuNumberAnimation {}
117// }
118// Behavior on opacity {
119// UbuntuNumberAnimation {}
120// }
121
122// onVisibleChanged: {
123// newNoteTitleTextField.forceActiveFocus();
124// }
125
126// TextField {
127// id: newNoteTitleTextField
128// objectName: "newNoteTitleTextField"
129// anchors { left: parent.left; right: parent.right; margins: units.gu(2); verticalCenter: parent.verticalCenter }
130// }
131// }
132
133 PulldownListView {90 PulldownListView {
134 id: tagsListView91 id: tagsListView
135 objectName: "tagsListView"92 objectName: "tagsListView"
136 model: tags93 model: tags
137 anchors { left: parent.left; right: parent.right }94 anchors { left: parent.left; right: parent.right }
138 height: parent.height - y - buttonRow.height - keyboardRect.height95 height: parent.height - y - keyboardRect.height
139 clip: true96 clip: true
14097
141 onRefreshed: {98 onRefreshed: {
@@ -169,51 +126,19 @@
169 }126 }
170 }127 }
171128
172 Label {
173 anchors.centerIn: parent
174 visible: !tags.loading && (tags.error || tagsListView.count == 0)
175 width: parent.width - units.gu(4)
176 wrapMode: Text.WordWrap
177 horizontalAlignment: Text.AlignHCenter
178 text: tags.error ? tags.error : i18n.tr("No tags available. You can tag notes while viewing them.")
179 }
180
181 Item {
182 id: buttonRow
183 anchors { left: parent.left; right: parent.right; margins: units.gu(2) }
184 height: 0
185 visible: height > 0
186 clip: true
187
188 Behavior on height {
189 UbuntuNumberAnimation {}
190 }
191
192 Button {
193 id: cancelButton
194 anchors { left: parent.left; verticalCenter: parent.verticalCenter }
195 text: i18n.tr("Cancel")
196 onClicked: {
197 newNoteTitleTextField.text = "";
198 contentColumn.newNotebook = false
199 }
200 }
201 Button {
202 objectName: "saveButton"
203 anchors { right: parent.right; verticalCenter: parent.verticalCenter }
204 text: i18n.tr("Save")
205 enabled: newNoteTitleTextField.text.length > 0
206 onClicked: {
207 NotesStore.createNotebook(newNoteTitleTextField.text);
208 newNoteTitleTextField.text = "";
209 contentColumn.newNotebook = false
210 }
211 }
212 }
213 Item {129 Item {
214 id: keyboardRect130 id: keyboardRect
215 anchors { left: parent.left; right: parent.right }131 anchors { left: parent.left; right: parent.right }
216 height: Qt.inputMethod.keyboardRectangle.height132 height: Qt.inputMethod.keyboardRectangle.height
217 }133 }
218 }134 }
135
136 Label {
137 anchors.centerIn: parent
138 visible: !tags.loading && (tags.error || tagsListView.count == 0)
139 width: parent.width - units.gu(4)
140 wrapMode: Text.WordWrap
141 horizontalAlignment: Text.AlignHCenter
142 text: tags.error ? tags.error : i18n.tr("No tags available. You can tag notes while viewing them.")
143 }
219}144}
220145
=== modified file 'src/libqtevernote/tags.h'
--- src/libqtevernote/tags.h 2014-10-23 21:27:46 +0000
+++ src/libqtevernote/tags.h 2014-11-16 01:04:51 +0000
@@ -69,4 +69,4 @@
69 QList<QString> m_list;69 QList<QString> m_list;
70};70};
7171
72#endif // NOTEBOOKS_H72#endif // TAGS_H

Subscribers

People subscribed via source and target branches