Merge pull request #1002 from maltee1/fix_send_with_input_method

properly commit preedit text
This commit is contained in:
DeepBlueV7.X 2022-03-20 04:27:23 +01:00 committed by GitHub
commit 3f134019f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -446,10 +446,10 @@ Rectangle {
width: 22
height: 22
image: ":/icons/icons/ui/send.svg"
Layout.rightMargin: 8
ToolTip.visible: hovered
ToolTip.text: qsTr("Send")
onClicked: {
messageInput.append(messageInput.preeditText)
room.input.send();
}
}

View file

@ -9,6 +9,7 @@
#include <QDropEvent>
#include <QFileDialog>
#include <QGuiApplication>
#include <QInputMethod>
#include <QMimeData>
#include <QMimeDatabase>
#include <QStandardPaths>
@ -234,6 +235,8 @@ InputBar::nextText()
void
InputBar::send()
{
QInputMethod *im = QGuiApplication::inputMethod();
im->commit();
if (text().trimmed().isEmpty())
return;