D12662: Add InlineNoteInterface
Michal Srb
noreply at phabricator.kde.org
Wed May 2 19:36:15 UTC 2018
michalsrb added a comment.
In D12662#257342 <https://phabricator.kde.org/D12662#257342>, @brauch wrote:
> Looks good from the implementation too so far. One thing I do not see is any changes to the cursorToX / xToCursor functions, is there really no change required there?
No change was really needed. As the spaces are created when laying out the line, either by offsetting the start of the line or by formatting the text, it gets stored in the layout and the cursorToX / xToCursor work as expected. Even moving the cursor around with arrow keys works nicely (the cursor moves to the closest position above/below even if one of the lines is shifted).
> Some things which come to my mind for testing would be:
>
> - is selection rendered correctly if it includes notes, at the end, beginning, or middle of lines, also mult-line selections?
I thought regular selection works fine, but actually I just found a glitch; if there is a note at the beginning of the line, it does not render the selection background under it:
F5831112: Screenshot_20180502_205152.png <https://phabricator.kde.org/F5831112>
A selection in block mode behaves like if the notes are not there:
F5831117: Screenshot_20180502_205212.png <https://phabricator.kde.org/F5831117>
I can't tell whether it is good or bad behavior. Do you think it should stay this way - selecting the block of the real text, or should it instead select a "visual" block?
I was thinking it would be best to avoid this problem and hide the notes when doing block mode selection, but should that be done by ktexteditor directly, or by the user of the interface? I also imagine that anything that uses it would provide some quick on/off toggle for cases like this.
> - what happens when clicking or dragging from or into the notes?
Clicking into the note always places the text cursor on the right side of the note - in other words, the note acts as extension of the letter on its left. Dragging makes normal selection from that position.
> - does it still work properly with dynamic word-wrap on?
Hmm, looks like notes at the beginning of the text ruin the breaking of the line:
F5831141: Screenshot_20180502_212929.png <https://phabricator.kde.org/F5831141>
And it also does not place the notes well if the wrapped line keeps keeps indentation, like in this case:
F5831123: Screenshot_20180502_210236.png <https://phabricator.kde.org/F5831123>
> - does it work properly with code-folding? what happens if a note is at the border of a folding region?
It works fine. When a line is hidden, so are the notes in it.
One more thing that needs to be decided: At this moment if a note is placed past the end of the text too far to the right and word-wrap is on, it does not wrap, but renders partially or completely out of view. (This happens kinda by default as the layout of the line is not modified for notes out of the text.) My thinking was that it does not matter as one would either place notes in the text, or outside at a column that will be visible without scrolling/wrapping. But if you think it should wrap, I can try to find a way to make that happen.
Thank you for the review, I'll fix these problems and make the changes you noted.
REPOSITORY
R39 KTextEditor
REVISION DETAIL
https://phabricator.kde.org/D12662
To: michalsrb, #ktexteditor
Cc: brauch, #frameworks, michaelh, kevinapavew, ngraham, bruns, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180502/897e38b4/attachment-0001.html>
More information about the Kde-frameworks-devel
mailing list