From 03a47d54f4b325fbb7ad81d30ea308424c658606 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 9 Jan 2023 02:50:58 +0100 Subject: [PATCH] Dirty spellchecking --- resources/qml/MessageInput.qml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/resources/qml/MessageInput.qml b/resources/qml/MessageInput.qml index 59b19d4d..30ca6cb9 100644 --- a/resources/qml/MessageInput.qml +++ b/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) {