From 3452821fb9ce35f00e37bc9e2bcee82ef9b33c2f Mon Sep 17 00:00:00 2001 From: Phenom Date: Sun, 26 Feb 2017 11:31:43 +0100 Subject: [PATCH] Add Shift+Enter to create new line in chat widget when Ctrl+Enter option is disabled. Proposed by MMT1 In the same time I fix the completer only when chat is lobby. --- retroshare-gui/src/gui/chat/ChatWidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index f31ee3b31..882efed26 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -614,7 +614,6 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event) else { completionWord.clear(); } - } if ((keyEvent->modifiers() & ui->chatTextEdit->getCompleterKeyModifiers()) && keyEvent->key() == ui->chatTextEdit->getCompleterKey()) { completer->setModel(modelFromPeers()); } @@ -622,6 +621,7 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event) ui->chatTextEdit->forceCompleterShowNextKeyEvent("@"); completer->setModel(modelFromPeers()); } + } if (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return) { // Enter pressed if (Settings->getChatSendMessageWithCtrlReturn()) { @@ -631,7 +631,7 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event) return true; // eat event } } else { - if (keyEvent->modifiers() & Qt::ControlModifier) { + if ((keyEvent->modifiers() & Qt::ControlModifier) || (keyEvent->modifiers() & Qt::ShiftModifier)){ // insert return ui->chatTextEdit->textCursor().insertText("\n"); } else {