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
1=== added file 'src/app/qml/components/EditTagsDialog.qml'
2--- src/app/qml/components/EditTagsDialog.qml 1970-01-01 00:00:00 +0000
3+++ src/app/qml/components/EditTagsDialog.qml 2014-11-16 01:04:51 +0000
4@@ -0,0 +1,127 @@
5+/*
6+ * Copyright: 2014 Canonical, Ltd
7+ *
8+ * This file is part of reminders
9+ *
10+ * reminders is free software: you can redistribute it and/or modify
11+ * it under the terms of the GNU General Public License as published by
12+ * the Free Software Foundation; version 3.
13+ *
14+ * reminders is distributed in the hope that it will be useful,
15+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+ * GNU General Public License for more details.
18+ *
19+ * You should have received a copy of the GNU General Public License
20+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21+ */
22+
23+import QtQuick 2.3
24+import QtQuick.Layouts 1.1
25+import Ubuntu.Components 1.1
26+import Ubuntu.Components.Popups 1.0
27+import Ubuntu.Components.ListItems 1.0
28+import Evernote 0.1
29+
30+Dialog {
31+ id: root
32+
33+ property var note
34+ property int pageHeight
35+
36+ Tags {
37+ id: tags
38+ }
39+
40+ RowLayout {
41+ Layout.preferredWidth: parent.width - units.gu(2)
42+ Layout.alignment: Qt.AlignHCenter
43+
44+ TextField {
45+ id: textField
46+ Layout.fillWidth: true
47+ placeholderText: i18n.tr("Create a new tag")
48+
49+ onAccepted: accept();
50+
51+ function accept() {
52+ var tagName = text;
53+ text = '';
54+
55+ // Check if the tag exists
56+ for (var i=0; i < tags.count; i++) {
57+ var tag = tags.tag(i);
58+ if (tag.name == tagName) {
59+ // The tag exists, check if is already selected: if it is,
60+ // do nothing, otherwise add to tags of the note
61+ if (note.tagGuids.indexOf(tag.guid) === -1) {
62+ note.tagGuids.push(tag.guid);
63+ }
64+ return;
65+ }
66+ }
67+
68+ NotesStore.createTag(tagName);
69+ }
70+ }
71+
72+ Button {
73+ text: i18n.tr("Create tag")
74+ color: UbuntuColors.orange
75+ enabled: textField.text.replace(/\s+/g, '') !== ''; // Not only whitespaces!
76+ onClicked: textField.accept()
77+ }
78+ }
79+
80+ Connections {
81+ target: NotesStore
82+ onTagAdded: {
83+ note.tagGuids.push(guid);
84+ }
85+ }
86+
87+ OptionSelector {
88+ id: optionSelector
89+
90+ Layout.preferredWidth: parent.width - units.gu(2)
91+ Layout.alignment: Qt.AlignHCenter
92+
93+ currentlyExpanded: true
94+ multiSelection: true
95+
96+ containerHeight: Math.min(root.pageHeight - textField.height - closeButton.height - units.gu(12), tags.count * itemHeight)
97+
98+ model: tags
99+
100+ delegate: OptionSelectorDelegate {
101+ text: model.name
102+ selected: root.note ? root.note.tagGuids.indexOf(model.guid) !== -1 : false
103+
104+ MouseArea {
105+ anchors.fill: parent
106+
107+ onClicked: {
108+ if (selected) {
109+ var index = root.note.tagGuids.indexOf(model.guid);
110+ root.note.tagGuids.splice(index, 1);
111+ }
112+ else {
113+ root.note.tagGuids.push(model.guid);
114+ }
115+ }
116+ }
117+ }
118+ }
119+
120+ Button {
121+ id: closeButton
122+ Layout.preferredWidth: parent.width - units.gu(2)
123+ Layout.alignment: Qt.AlignHCenter
124+
125+ color: UbuntuColors.orange
126+
127+ text: i18n.tr("Done")
128+
129+ onClicked: PopupUtils.close(root)
130+ }
131+}
132
133=== modified file 'src/app/qml/components/TagsDelegate.qml'
134--- src/app/qml/components/TagsDelegate.qml 2014-10-09 00:08:52 +0000
135+++ src/app/qml/components/TagsDelegate.qml 2014-11-16 01:04:51 +0000
136@@ -61,6 +61,7 @@
137 objectName: 'tagTitleLabel'
138 text: model.name
139 fontSize: "large"
140+ Layout.fillWidth: true
141
142 MouseArea {
143 onPressAndHold: {
144
145=== modified file 'src/app/qml/reminders.qml'
146--- src/app/qml/reminders.qml 2014-11-12 23:48:03 +0000
147+++ src/app/qml/reminders.qml 2014-11-16 01:04:51 +0000
148@@ -93,9 +93,11 @@
149 var page = component.createObject(root);
150 page.note = note;
151 page.editNote.connect(function(note) {root.switchToEditMode(note)})
152+ page.openTaggedNotes.connect(function(title, tagGuid) {pagestack.pop();root.openTaggedNotes(title, tagGuid, true)})
153 pagestack.push(page)
154 } else {
155 var view = sideViewLoader.embed(Qt.resolvedUrl("ui/NoteView.qml"))
156+ view.openTaggedNotes.connect(function(title, tagGuid) {root.openTaggedNotes(title, tagGuid, false)})
157 view.note = note;
158 }
159 }
160@@ -222,6 +224,25 @@
161 }
162 }
163
164+ function openTaggedNotes(title, tagGuid, narrowMode) {
165+ var component = Qt.createComponent(Qt.resolvedUrl("ui/NotesPage.qml"))
166+ var page = component.createObject();
167+ print("opening note page for tag", tagGuid)
168+ pagestack.push(page, {title: title, filterTagGuid: tagGuid, narrowMode: narrowMode});
169+ page.selectedNoteChanged.connect(function() {
170+ if (page.selectedNote) {
171+ root.displayNote(page.selectedNote);
172+ if (root.narrowMode) {
173+ page.selectedNote = null;
174+ }
175+ }
176+ })
177+ page.editNote.connect(function(note) {
178+ root.switchToEditMode(note)
179+ })
180+ NotesStore.refreshNotes();
181+ }
182+
183 AccountServiceModel {
184 id: accounts
185 applicationId: "com.ubuntu.reminders_reminders"
186
187=== modified file 'src/app/qml/ui/EditNoteView.qml'
188--- src/app/qml/ui/EditNoteView.qml 2014-11-13 11:02:14 +0000
189+++ src/app/qml/ui/EditNoteView.qml 2014-11-16 01:04:51 +0000
190@@ -42,6 +42,21 @@
191
192 signal exitEditMode(var note)
193
194+ function saveNote() {
195+ var title = titleTextField.text ? titleTextField.text : i18n.tr("Untitled");
196+ var notebookGuid = notebookSelector.selectedGuid;
197+ var text = noteTextArea.text;
198+
199+ if (note) {
200+ note.title = titleTextField.text;
201+ note.notebookGuid = notebookSelector.selectedGuid;
202+ note.richTextContent = noteTextArea.text;
203+ NotesStore.saveNote(note.guid);
204+ } else {
205+ NotesStore.createNote(title, notebookGuid, text);
206+ }
207+ }
208+
209 QtObject {
210 id: priv
211 property int insertPosition
212@@ -105,18 +120,7 @@
213 MouseArea {
214 anchors.fill: parent
215 onClicked: {
216- var title = titleTextField.text ? titleTextField.text : i18n.tr("Untitled");
217- var notebookGuid = notebookSelector.selectedGuid;
218- var text = noteTextArea.text;
219-
220- if (note) {
221- note.title = titleTextField.text
222- note.notebookGuid = notebookSelector.selectedGuid
223- note.richTextContent = noteTextArea.text
224- NotesStore.saveNote(note.guid);
225- } else {
226- NotesStore.createNote(title, notebookGuid, text);
227- }
228+ saveNote();
229 root.exitEditMode(root.note);
230 }
231 }
232@@ -369,6 +373,11 @@
233 }
234 }
235
236+ Component {
237+ id: tagsDialog
238+ EditTagsDialog { note: root.note; pageHeight: parent.height }
239+ }
240+
241 Rectangle {
242 anchors.fill: toolbox
243 color: "#efefef"
244@@ -383,6 +392,7 @@
245
246 property bool charFormatExpanded: false
247 property bool blockFormatExpanded: false
248+ property bool tagsRowExpanded: false
249
250 Behavior on height { UbuntuNumberAnimation {} }
251
252@@ -581,6 +591,57 @@
253 }
254 }
255
256+ Row {
257+ anchors { left: parent.left; right: parent.right; rightMargin: units.gu(1) }
258+ height: units.gu(4)
259+ visible: toolbox.tagsRowExpanded
260+ spacing: units.gu(1)
261+
262+ Rectangle {
263+ z: 100
264+ color: "#efefef"
265+ height: parent.height
266+ width: height + units.gu(1)
267+ RtfButton {
268+ id: editTagsButton
269+ iconName: "edit"
270+ height: parent.height
271+ width: height
272+ anchors.horizontalCenter: parent.horizontalCenter
273+ onClicked: {
274+ PopupUtils.open(tagsDialog)
275+ }
276+ }
277+ }
278+
279+ ListView {
280+ width: parent.width - editTagsButton.width - units.gu(1)
281+ height: units.gu(4)
282+
283+ model: root.note ? root.note.tagGuids.length : undefined
284+ orientation: ListView.Horizontal
285+ spacing: units.gu(1)
286+
287+
288+ delegate: Rectangle {
289+ id: rectangle
290+ radius: units.gu(1)
291+ color: "white"
292+ border.color: preferences.colorForNotebook(root.note.notebookGuid)
293+ anchors.verticalCenter: parent.verticalCenter
294+ Text {
295+ text: NotesStore.tag(root.note.tagGuids[index]).name
296+ color: preferences.colorForNotebook(root.note.notebookGuid)
297+ Component.onCompleted: {
298+ rectangle.width = width + units.gu(2)
299+ rectangle.height = height + units.gu(1)
300+ anchors.centerIn = parent
301+ }
302+ }
303+ }
304+ }
305+ }
306+
307 RowLayout {
308 anchors { left: parent.left; right: parent.right }
309 anchors.margins: units.gu(1)
310@@ -648,6 +709,18 @@
311 RtfSeparator {}
312
313 RtfButton {
314+ iconSource: "../images/tags.svg"
315+ height: parent.height
316+ width: height
317+ active: toolbox.tagsRowExpanded
318+ onClicked: {
319+ toolbox.tagsRowExpanded = !toolbox.tagsRowExpanded
320+ }
321+ }
322+
323+ RtfSeparator {}
324+
325+ RtfButton {
326 iconName: "navigation-menu"
327 height: parent.height
328 width: height
329
330=== modified file 'src/app/qml/ui/NotePage.qml'
331--- src/app/qml/ui/NotePage.qml 2014-09-23 12:39:27 +0000
332+++ src/app/qml/ui/NotePage.qml 2014-11-16 01:04:51 +0000
333@@ -27,6 +27,7 @@
334 property alias note: noteView.note
335
336 signal editNote(var note)
337+ signal openTaggedNotes(string title, string tagGuid)
338
339 tools: ToolbarItems {
340 ToolbarButton {
341@@ -68,8 +69,9 @@
342 id: noteView
343 anchors.fill: parent
344
345- onEditNote: {
346- root.editNote(note) ;
347+ onOpenTaggedNotes: {
348+ console.log('babbo natale')
349+ root.openTaggedNotes(title, tagGuid);
350 }
351 }
352 }
353
354=== modified file 'src/app/qml/ui/NoteView.qml'
355--- src/app/qml/ui/NoteView.qml 2014-10-10 10:59:00 +0000
356+++ src/app/qml/ui/NoteView.qml 2014-11-16 01:04:51 +0000
357@@ -27,7 +27,7 @@
358 property string title: note ? note.title : ""
359 property var note: null
360
361- signal editNote(var note)
362+ signal openTaggedNotes(string title, string tagGuid)
363
364 onNoteChanged: {
365 if (root.note != null) {
366@@ -54,7 +54,8 @@
367
368 WebView {
369 id: noteTextArea
370- anchors { fill: parent}
371+ width: parent.width
372+ height: parent.height - tagsRow.height - (tagsRow.height > 0 ? units.gu(2) : 0)
373
374 property string html: root.note ? note.htmlContent : ""
375
376@@ -89,5 +90,41 @@
377 }
378 }
379 ]
380- }
381+ }
382+
383+ ListView {
384+ id: tagsRow
385+ anchors { left: parent.left; right: parent.right; bottom: parent.bottom; margins: units.gu(1) }
386+ model: root.note ? root.note.tagGuids.length : undefined
387+ orientation: ListView.Horizontal
388+ spacing: units.gu(1)
389+ height: units.gu(3)
390+
391+ delegate: Rectangle {
392+ id: rectangle
393+ radius: units.gu(1)
394+ color: "white"
395+ border.color: preferences.colorForNotebook(root.note.notebookGuid)
396+
397+ Text {
398+ text: NotesStore.tag(root.note.tagGuids[index]).name
399+ color: preferences.colorForNotebook(root.note.notebookGuid)
400+ Component.onCompleted: {
401+ rectangle.width = width + units.gu(2)
402+ rectangle.height = height + units.gu(1)
403+ anchors.centerIn = parent
404+ }
405+ }
406+
407+ MouseArea {
408+ anchors.fill: parent
409+ onClicked: {
410+ if (!narrowMode) {
411+ sideViewLoader.clear();
412+ }
413+ root.openTaggedNotes(NotesStore.tag(root.note.tagGuids[index]).name, NotesStore.tag(root.note.tagGuids[index]).guid)
414+ }
415+ }
416+ }
417+ }
418 }
419
420=== modified file 'src/app/qml/ui/TagsPage.qml'
421--- src/app/qml/ui/TagsPage.qml 2014-11-12 23:48:03 +0000
422+++ src/app/qml/ui/TagsPage.qml 2014-11-16 01:04:51 +0000
423@@ -44,49 +44,39 @@
424 }
425 }
426
427-// tools: ToolbarItems {
428-// ToolbarButton {
429-// action: Action {
430-// objectName: "addNotebookButton"
431-// text: i18n.tr("Add notebook")
432-// iconName: "add"
433-// onTriggered: {
434-// contentColumn.newNotebook = true;
435-// }
436-// }
437-// }
438-
439-// ToolbarButton {
440-// action: Action {
441-// text: i18n.tr("Search")
442-// iconName: "search"
443-// onTriggered: {
444-// pagestack.push(Qt.resolvedUrl("SearchNotesPage.qml"))
445-// }
446-// }
447-// }
448-
449-// ToolbarButton {
450-// action: Action {
451-// text: i18n.tr("Refresh")
452-// iconName: "reload"
453-// onTriggered: {
454-// NotesStore.refreshNotebooks();
455-// }
456-// }
457-// }
458-
459-// ToolbarButton {
460-// action: Action {
461-// text: i18n.tr("Accounts")
462-// iconName: "contacts-app-symbolic"
463-// visible: accounts.count > 1
464-// onTriggered: {
465-// openAccountPage(true);
466-// }
467-// }
468-// }
469-// }
470+ tools: ToolbarItems {
471+ ToolbarButton {
472+ action: Action {
473+ text: i18n.tr("Search")
474+ iconName: "search"
475+ onTriggered: {
476+ pagestack.push(Qt.resolvedUrl("SearchNotesPage.qml"))
477+ }
478+ }
479+ }
480+
481+ ToolbarButton {
482+ action: Action {
483+ text: i18n.tr("Refresh")
484+ iconName: "reload"
485+ onTriggered: {
486+ NotesStore.refreshNotes();
487+ tags.refresh();
488+ }
489+ }
490+ }
491+
492+ ToolbarButton {
493+ action: Action {
494+ text: i18n.tr("Accounts")
495+ iconName: "contacts-app-symbolic"
496+ visible: accounts.count > 1
497+ onTriggered: {
498+ openAccountPage(true);
499+ }
500+ }
501+ }
502+ }
503
504 Tags {
505 id: tags
506@@ -97,45 +87,12 @@
507 anchors.fill: parent
508 property bool newNotebook: false
509
510-// states: [
511-// State {
512-// name: "newNotebook"; when: contentColumn.newNotebook
513-// PropertyChanges { target: newNotebookContainer; opacity: 1; height: newNotebookContainer.implicitHeight }
514-// PropertyChanges { target: buttonRow; opacity: 1; height: cancelButton.height + units.gu(4) }
515-// }
516-// ]
517-
518-// Empty {
519-// id: newNotebookContainer
520-// height: 0
521-// visible: opacity > 0
522-// opacity: 0
523-// clip: true
524-
525-// Behavior on height {
526-// UbuntuNumberAnimation {}
527-// }
528-// Behavior on opacity {
529-// UbuntuNumberAnimation {}
530-// }
531-
532-// onVisibleChanged: {
533-// newNoteTitleTextField.forceActiveFocus();
534-// }
535-
536-// TextField {
537-// id: newNoteTitleTextField
538-// objectName: "newNoteTitleTextField"
539-// anchors { left: parent.left; right: parent.right; margins: units.gu(2); verticalCenter: parent.verticalCenter }
540-// }
541-// }
542-
543 PulldownListView {
544 id: tagsListView
545 objectName: "tagsListView"
546 model: tags
547 anchors { left: parent.left; right: parent.right }
548- height: parent.height - y - buttonRow.height - keyboardRect.height
549+ height: parent.height - y - keyboardRect.height
550 clip: true
551
552 onRefreshed: {
553@@ -169,51 +126,19 @@
554 }
555 }
556
557- Label {
558- anchors.centerIn: parent
559- visible: !tags.loading && (tags.error || tagsListView.count == 0)
560- width: parent.width - units.gu(4)
561- wrapMode: Text.WordWrap
562- horizontalAlignment: Text.AlignHCenter
563- text: tags.error ? tags.error : i18n.tr("No tags available. You can tag notes while viewing them.")
564- }
565-
566- Item {
567- id: buttonRow
568- anchors { left: parent.left; right: parent.right; margins: units.gu(2) }
569- height: 0
570- visible: height > 0
571- clip: true
572-
573- Behavior on height {
574- UbuntuNumberAnimation {}
575- }
576-
577- Button {
578- id: cancelButton
579- anchors { left: parent.left; verticalCenter: parent.verticalCenter }
580- text: i18n.tr("Cancel")
581- onClicked: {
582- newNoteTitleTextField.text = "";
583- contentColumn.newNotebook = false
584- }
585- }
586- Button {
587- objectName: "saveButton"
588- anchors { right: parent.right; verticalCenter: parent.verticalCenter }
589- text: i18n.tr("Save")
590- enabled: newNoteTitleTextField.text.length > 0
591- onClicked: {
592- NotesStore.createNotebook(newNoteTitleTextField.text);
593- newNoteTitleTextField.text = "";
594- contentColumn.newNotebook = false
595- }
596- }
597- }
598 Item {
599 id: keyboardRect
600 anchors { left: parent.left; right: parent.right }
601 height: Qt.inputMethod.keyboardRectangle.height
602 }
603 }
604+
605+ Label {
606+ anchors.centerIn: parent
607+ visible: !tags.loading && (tags.error || tagsListView.count == 0)
608+ width: parent.width - units.gu(4)
609+ wrapMode: Text.WordWrap
610+ horizontalAlignment: Text.AlignHCenter
611+ text: tags.error ? tags.error : i18n.tr("No tags available. You can tag notes while viewing them.")
612+ }
613 }
614
615=== modified file 'src/libqtevernote/tags.h'
616--- src/libqtevernote/tags.h 2014-10-23 21:27:46 +0000
617+++ src/libqtevernote/tags.h 2014-11-16 01:04:51 +0000
618@@ -69,4 +69,4 @@
619 QList<QString> m_list;
620 };
621
622-#endif // NOTEBOOKS_H
623+#endif // TAGS_H

Subscribers

People subscribed via source and target branches