diff options
author | Jussi Kuokkanen <jussi.kuokkanen@protonmail.com> | 2020-08-31 12:21:47 +0300 |
---|---|---|
committer | Jussi Kuokkanen <jussi.kuokkanen@protonmail.com> | 2020-08-31 12:21:47 +0300 |
commit | 254b7549eba383fb9e842b9524d5388d466696b4 (patch) | |
tree | 579885bff326d9ccc502a065eb531eab00315ebb /src/TextInputWidget.cpp | |
parent | don't select emoji completion by default and add minimum string length before... (diff) | |
download | nheko-254b7549eba383fb9e842b9524d5388d466696b4.tar.xz |
ignore enter keypress when completion is selected
Diffstat (limited to '')
-rw-r--r-- | src/TextInputWidget.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/TextInputWidget.cpp b/src/TextInputWidget.cpp index 770aaca1..47e239cd 100644 --- a/src/TextInputWidget.cpp +++ b/src/TextInputWidget.cpp @@ -256,12 +256,13 @@ FilteredTextEdit::keyPressEvent(QKeyEvent *event) case Qt::Key_Enter: if (emoji_popup_open_) { if (!completer_->popup()->currentIndex().isValid()) { - // No completion to select, do normal behavior - completer_->popup()->hide(); - emoji_popup_open_ = false; - } - else - event->ignore(); + // No completion to select, do normal behavior + completer_->popup()->hide(); + emoji_popup_open_ = false; + } else { + event->ignore(); + return; + } } if (!(event->modifiers() & Qt::ShiftModifier)) { |