summary refs log tree commit diff
path: root/src/QuickSwitcher.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-04-27 14:04:13 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-04-27 14:04:13 +0300
commit2c6192d08f8f609c32adfb56c628dc86b43c8c54 (patch)
treea2375f2d6193ebb7404d2e0b8555a25418da9fff /src/QuickSwitcher.cc
parentImprove room searching (diff)
downloadnheko-2c6192d08f8f609c32adfb56c628dc86b43c8c54.tar.xz
Fix clicking on room list suggestions
Diffstat (limited to 'src/QuickSwitcher.cc')
-rw-r--r--src/QuickSwitcher.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/QuickSwitcher.cc b/src/QuickSwitcher.cc

index d406a6de..3596a8c4 100644 --- a/src/QuickSwitcher.cc +++ b/src/QuickSwitcher.cc
@@ -103,11 +103,13 @@ QuickSwitcher::QuickSwitcher(QSharedPointer<Cache> cache, QWidget *parent) &RoomSearchInput::selectPreviousCompletion, &popup_, &SuggestionsPopup::selectPreviousSuggestion); - connect(&popup_, &SuggestionsPopup::itemSelected, this, &QuickSwitcher::roomSelected); + connect(&popup_, &SuggestionsPopup::itemSelected, this, [this](const QString &room_id) { + reset(); + emit roomSelected(room_id); + }); connect(roomSearch_, &RoomSearchInput::hiding, this, [this]() { popup_.hide(); }); connect(roomSearch_, &QLineEdit::returnPressed, this, [this]() { - emit closing(); - roomSearch_->clear(); + reset(); popup_.selectHoveredSuggestion<RoomItem>(); }); } @@ -125,8 +127,7 @@ void QuickSwitcher::keyPressEvent(QKeyEvent *event) { if (event->key() == Qt::Key_Escape) { - roomSearch_->clear(); event->accept(); - emit closing(); + reset(); } }