mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-27 21:48:48 +03:00
Dirty spellchecking
This commit is contained in:
parent
b84bc7895e
commit
03a47d54f4
1 changed files with 16 additions and 0 deletions
|
@ -11,6 +11,7 @@ import QtQuick.Controls 2.3
|
||||||
import QtQuick.Layouts 1.2
|
import QtQuick.Layouts 1.2
|
||||||
import QtQuick.Window 2.13
|
import QtQuick.Window 2.13
|
||||||
import im.nheko 1.0
|
import im.nheko 1.0
|
||||||
|
import org.kde.sonnet 1.0 as Sonnet
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: inputBar
|
id: inputBar
|
||||||
|
@ -117,6 +118,21 @@ Rectangle {
|
||||||
TextArea {
|
TextArea {
|
||||||
id: messageInput
|
id: messageInput
|
||||||
|
|
||||||
|
|
||||||
|
Sonnet.SpellcheckHighlighter {
|
||||||
|
id: spellcheckhighlighter
|
||||||
|
document: messageInput.textDocument
|
||||||
|
cursorPosition: messageInput.cursorPosition
|
||||||
|
selectionStart: messageInput.selectionStart
|
||||||
|
selectionEnd: messageInput.selectionEnd
|
||||||
|
misspelledColor: Nheko.theme.error
|
||||||
|
|
||||||
|
onChangeCursorPosition: {
|
||||||
|
messageInput.cursorPosition = start;
|
||||||
|
messageInput.moveCursorSelection(end, TextEdit.SelectCharacters);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
property int completerTriggeredAt: 0
|
property int completerTriggeredAt: 0
|
||||||
|
|
||||||
function insertCompletion(completion) {
|
function insertCompletion(completion) {
|
||||||
|
|
Loading…
Reference in a new issue