Dirty spellchecking

spellcheck
Nicolas Werner 2 years ago
parent b84bc7895e
commit 03a47d54f4
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 16
      resources/qml/MessageInput.qml

@ -11,6 +11,7 @@ import QtQuick.Controls 2.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.13
import im.nheko 1.0
import org.kde.sonnet 1.0 as Sonnet
Rectangle {
id: inputBar
@ -117,6 +118,21 @@ Rectangle {
TextArea {
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
function insertCompletion(completion) {

Loading…
Cancel
Save