From afe8a2a5e461bcb57effad193d40ec54014f861b Mon Sep 17 00:00:00 2001 From: James Graham Date: Tue, 14 Mar 2023 22:26:18 +0000 Subject: [PATCH] Newline Mobile Make return/enter create a newline on mobile. This is the traditional behaviour in other messengers as the send icon and return have are the same time to access and solves the linked issue. Closes network/neochat#466 --- src/qml/Component/ChatBox/ChatBar.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qml/Component/ChatBox/ChatBar.qml b/src/qml/Component/ChatBox/ChatBar.qml index f529a4aaf..2efb8363d 100644 --- a/src/qml/Component/ChatBox/ChatBar.qml +++ b/src/qml/Component/ChatBox/ChatBar.qml @@ -143,7 +143,7 @@ QQC2.Control { Keys.onEnterPressed: { if (completionMenu.visible) { completionMenu.complete() - } else if (event.modifiers & Qt.ShiftModifier) { + } else if (event.modifiers & Qt.ShiftModifier || Kirigami.Settings.isMobile) { textField.insert(cursorPosition, "\n") } else { chatBar.postMessage(); @@ -152,7 +152,7 @@ QQC2.Control { Keys.onReturnPressed: { if (completionMenu.visible) { completionMenu.complete() - } else if (event.modifiers & Qt.ShiftModifier) { + } else if (event.modifiers & Qt.ShiftModifier || Kirigami.Settings.isMobile) { textField.insert(cursorPosition, "\n") } else { chatBar.postMessage();