From 1ffca37021f439c10cf12b95710f2efe2f89f168 Mon Sep 17 00:00:00 2001 From: miruka Date: Sat, 20 Jul 2019 14:37:21 -0400 Subject: [PATCH] Fix sendbox modifier+enter for newline not working --- TODO.md | 7 +++++-- src/qml/Chat/SendBox.qml | 11 +++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/TODO.md b/TODO.md index 99ca0db3..73a99d44 100644 --- a/TODO.md +++ b/TODO.md @@ -22,9 +22,11 @@ - EditAccount page: - Device settings - Multiaccount aliases: - - Warn when overwriting another alias + - Warn when conflict with another alias - Forbid spaces? - Add an explanation tooltip + - Prevent sending messages with an user not in room + - Support \ escaping - Improve avatar tooltips position, add stuff to room tooltips (last msg?) - Accept drag and dropping a picture in account settings to set avatar - When all the events loaded on beginning in a room are name/avatar changes, @@ -94,7 +96,8 @@ - Animate RoomEventDelegate DayBreak apparition - Room subtitle: show things like "*Image*" instead of blank, etc -- Missing nio support +- nio + - downloads API - MatrixRoom invited members list - Invite events are missing their timestamps (needed for sorting) - Left room events after client reboot diff --git a/src/qml/Chat/SendBox.qml b/src/qml/Chat/SendBox.qml index 5f01502f..f2ece5d5 100644 --- a/src/qml/Chat/SendBox.qml +++ b/src/qml/Chat/SendBox.qml @@ -6,7 +6,7 @@ import QtQuick.Layouts 1.12 import "../Base" HRectangle { - function setFocus() { textArea.forceActiveFocus() } + function setFocus() { areaScrollView.forceActiveFocus() } property var aliases: window.settings.write_aliases property string writingUserId: chatPage.userId @@ -14,10 +14,12 @@ HRectangle { property bool textChangedSinceLostFocus: false + property alias textArea: areaScrollView.area + id: sendBox Layout.fillWidth: true Layout.minimumHeight: theme.baseElementsHeight - Layout.preferredHeight: textArea.implicitHeight + Layout.preferredHeight: areaScrollView.implicitHeight // parent.height / 2 causes binding loop? Layout.maximumHeight: pageStack.height / 2 color: theme.chat.sendBox.background @@ -35,7 +37,7 @@ HRectangle { Layout.fillWidth: true Layout.topMargin: Math.max(0, sendBox.Layout.minimumHeight - 34) - id: textArea + id: areaScrollView placeholderText: qsTr("Type a message...") backgroundColor: "transparent" area.focus: true @@ -105,7 +107,8 @@ HRectangle { if (event.modifiers & Qt.ShiftModifier || event.modifiers & Qt.ControlModifier || - event.modifiers & Qt.AltModifier) { + event.modifiers & Qt.AltModifier) + { textArea.insert(textArea.cursorPosition, "\n") return }