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
This commit is contained in:
Jani Mustonen 2017-11-03 08:54:17 +02:00 committed by mujx
parent beda0db543
commit 13cb0521fa
6 changed files with 31 additions and 13 deletions

View file

@ -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();
});