Default to the first item in room selection menu

- Add backwards navigation with backtab

fixes #316
remotes/origin/HEAD
Konstantinos Sideris 7 years ago
parent f1b355f7a7
commit d6ac72ab3f
  1. 17
      src/QuickSwitcher.cc
  2. 4
      src/SuggestionsPopup.cpp

@ -31,17 +31,22 @@ RoomSearchInput::RoomSearchInput(QWidget *parent)
void
RoomSearchInput::keyPressEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key_Tab || event->key() == Qt::Key_Down) {
switch (event->key()) {
case Qt::Key_Tab:
case Qt::Key_Down: {
emit selectNextCompletion();
event->accept();
return;
} else if (event->key() == Qt::Key_Up) {
break;
}
case Qt::Key_Backtab:
case Qt::Key_Up: {
emit selectPreviousCompletion();
event->accept();
return;
break;
}
default:
TextField::keyPressEvent(event);
}
TextField::keyPressEvent(event);
}
void

@ -136,6 +136,8 @@ SuggestionsPopup::addRooms(const std::vector<RoomSearchResult> &rooms)
adjustSize();
resize(geometry().width(), 40 * rooms.size());
selectNextSuggestion();
}
void
@ -158,6 +160,8 @@ SuggestionsPopup::addUsers(const QVector<SearchResult> &users)
adjustSize();
resize(geometry().width(), 40 * users.size());
selectNextSuggestion();
}
void

Loading…
Cancel
Save