← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/advanced-text-editor into lp:ubuntu-docviewer-app

 

The proposal to merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/advanced-text-editor into lp:ubuntu-docviewer-app has been updated.

Description changed to:

- Added a new QML module that provides a new TextArea component, which will be extended in future with a syntax highlighter.

- Bumped app version to 0.4, since this update introduces a new feature.

### Details

Text files are now read by a C++ class, that works asynchronously.

Default header in TextView has been updated, and now provides a "search" action (not enabled yet), a "selection" mode and a settings page.

We provide a separated "selection" mode for the header, because of a number of issues in the UITK. See "Notes" section in this description of the change.

Text settings - the new TextEditor component supports the following settings: show line numbers, wrap text, highlight current line and show right margin at column xx.

Line numbers in TextEditor are provided by a C++ class. I preferred this implementation for keeping the code clean and fast.

DocumentHandler class is BSD licensed, and it's a fork of a demo project from Digia. BSD license is compatible with GPL v3, so there should be no issue with it.

### Notes

Here's some thoughts about the current UITK.

I had to partially fork the upstream TextArea component, because it does not provide a way to access to the "textDocument" property of the internal TextEdit (known issue).

Another issue I found is that it wasn't possible to implement the text selection used in UITK.TextArea: the components are declared as internals and/or depends on some features which are not exported via the Ubuntu.Components module.

I'd like to see the internal components of Ubuntu.Components module exposed as Ubuntu.Components.Private and/or having a blank TextEdit that uses all the goodies from UITK.

About the "text selection" mode:
There are two issues here.
A first implementation of the selection mode used the standard PageHead.actions. It seems that the actions popover in the header forwards mouse events to the component below: if an user clicks on  an action (e.g. "copy), that click also affects the TextEditor below the popover, deselecting the text before it's effectively copied.

The second issue is a known one, and it's about the alignment of PageHead.contents. Actions in TextViewSelectionHeader are not aligned because of some issue in getting the parent of the layout item.

For more details, see:
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/advanced-text-editor/+merge/257943
-- 
Your team Ubuntu Document Viewer Developers is requested to review the proposed merge of lp:~verzegnassi-stefano/ubuntu-docviewer-app/advanced-text-editor into lp:ubuntu-docviewer-app.


Follow ups