summary refs log tree commit diff
path: root/src/QuickSwitcher.cc
diff options
context:
space:
mode:
authorJani Mustonen <janijohannes@kapsi.fi>2017-11-03 08:54:17 +0200
committermujx <mujx@users.noreply.github.com>2017-11-03 08:54:17 +0200
commit13cb0521fa4fd692f66a89c83ef17b7e3ea339bb (patch)
tree632e0721e88b301e2ed7b45a10e9f48bf18004f6 /src/QuickSwitcher.cc
parentUpdate issue template (diff)
downloadnheko-13cb0521fa4fd692f66a89c83ef17b7e3ea339bb.tar.xz
Improvements to the quick switcher (#109)
- Ghetto disambiguation for the quick switcher
- Fix the Ctrl+K shortcut
- Fix keyboard focus when the quick switcher is closed

fixes #114
Diffstat (limited to 'src/QuickSwitcher.cc')
-rw-r--r--src/QuickSwitcher.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/QuickSwitcher.cc b/src/QuickSwitcher.cc

index 542eebd9..2be636a4 100644 --- a/src/QuickSwitcher.cc +++ b/src/QuickSwitcher.cc
@@ -122,7 +122,16 @@ QuickSwitcher::QuickSwitcher(QWidget *parent) roomSearch_, &RoomSearchInput::hiding, this, [=]() { completer_->popup()->hide(); }); connect(roomSearch_, &QLineEdit::returnPressed, this, [=]() { emit closing(); - emit roomSelected(rooms_[this->roomSearch_->text().trimmed()]); + + QString text(""); + + if (selection_ == -1) { + completer_->setCurrentRow(0); + text = completer_->currentCompletion(); + } else { + text = this->roomSearch_->text().trimmed(); + } + emit roomSelected(rooms_[text]); roomSearch_->clear(); });