mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 08:59:37 -05:00
Merge pull request #697 from PhenomRetroShare/Add_ShiftEnterForNewLineInChatWidget
Add Shift+Enter to create new line in chat widget when Ctrl+Enter option
This commit is contained in:
commit
5f8c57c9b9
@ -614,7 +614,6 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
|
|||||||
else {
|
else {
|
||||||
completionWord.clear();
|
completionWord.clear();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if ((keyEvent->modifiers() & ui->chatTextEdit->getCompleterKeyModifiers()) && keyEvent->key() == ui->chatTextEdit->getCompleterKey()) {
|
if ((keyEvent->modifiers() & ui->chatTextEdit->getCompleterKeyModifiers()) && keyEvent->key() == ui->chatTextEdit->getCompleterKey()) {
|
||||||
completer->setModel(modelFromPeers());
|
completer->setModel(modelFromPeers());
|
||||||
}
|
}
|
||||||
@ -622,6 +621,7 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
|
|||||||
ui->chatTextEdit->forceCompleterShowNextKeyEvent("@");
|
ui->chatTextEdit->forceCompleterShowNextKeyEvent("@");
|
||||||
completer->setModel(modelFromPeers());
|
completer->setModel(modelFromPeers());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return) {
|
if (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return) {
|
||||||
// Enter pressed
|
// Enter pressed
|
||||||
if (Settings->getChatSendMessageWithCtrlReturn()) {
|
if (Settings->getChatSendMessageWithCtrlReturn()) {
|
||||||
@ -631,7 +631,7 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
|
|||||||
return true; // eat event
|
return true; // eat event
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (keyEvent->modifiers() & Qt::ControlModifier) {
|
if ((keyEvent->modifiers() & Qt::ControlModifier) || (keyEvent->modifiers() & Qt::ShiftModifier)){
|
||||||
// insert return
|
// insert return
|
||||||
ui->chatTextEdit->textCursor().insertText("\n");
|
ui->chatTextEdit->textCursor().insertText("\n");
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user