diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-09-13 11:31:58 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-09-13 11:58:09 +0200 |
commit | 152aff4c7e26c4eccf0168ae401dbcd13b54c796 (patch) | |
tree | b319bd0b693fe3a486df2079e4fbbd372927fd8b /framework/qml/TextEditor.qml | |
parent | 2f17eb055e3404bb36ee0d02082d3e1ab4a958cf (diff) | |
download | kube-152aff4c7e26c4eccf0168ae401dbcd13b54c796.tar.gz kube-152aff4c7e26c4eccf0168ae401dbcd13b54c796.zip |
We don't want persistentSelection and centralize the setCursorPosition
hack
Which breaks mouse selection btw.
Diffstat (limited to 'framework/qml/TextEditor.qml')
-rw-r--r-- | framework/qml/TextEditor.qml | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/framework/qml/TextEditor.qml b/framework/qml/TextEditor.qml index 8a298989..724ee03f 100644 --- a/framework/qml/TextEditor.qml +++ b/framework/qml/TextEditor.qml | |||
@@ -42,11 +42,16 @@ FocusScope { | |||
42 | Kube.DocumentHandler { | 42 | Kube.DocumentHandler { |
43 | id: document | 43 | id: document |
44 | document: edit.textDocument | 44 | document: edit.textDocument |
45 | cursorPosition: edit.cursorPosition | ||
46 | selectionStart: edit.selectionStart | 45 | selectionStart: edit.selectionStart |
47 | selectionEnd: edit.selectionEnd | 46 | selectionEnd: edit.selectionEnd |
48 | //textColor: colorDialog.color | 47 | //textColor: colorDialog.color |
49 | onTextChanged: root.htmlEnabled ? root.text = htmlText : root.text = plainText | 48 | onTextChanged: root.htmlEnabled ? root.text = htmlText : root.text = plainText |
49 | |||
50 | cursorPosition: edit.cursorPosition | ||
51 | onCursorPositionChanged: { | ||
52 | //Only necessary to skip over invisible char | ||
53 | edit.cursorPosition = cursorPosition | ||
54 | } | ||
50 | } | 55 | } |
51 | 56 | ||
52 | Kube.ScrollHelper { | 57 | Kube.ScrollHelper { |
@@ -62,10 +67,8 @@ FocusScope { | |||
62 | focus: true | 67 | focus: true |
63 | anchors.fill: parent | 68 | anchors.fill: parent |
64 | selectByMouse: true | 69 | selectByMouse: true |
65 | persistentSelection: true | ||
66 | wrapMode: TextEdit.Wrap | 70 | wrapMode: TextEdit.Wrap |
67 | textFormat: Qt.RichText | 71 | textFormat: Qt.RichText |
68 | cursorPosition: document.cursorPosition | ||
69 | } | 72 | } |
70 | TextArea.flickable: edit | 73 | TextArea.flickable: edit |
71 | } | 74 | } |