Skip to content
Snippets Groups Projects
Commit d6ac72ab authored by Konstantinos Sideris's avatar Konstantinos Sideris
Browse files

Default to the first item in room selection menu

- Add backwards navigation with backtab

fixes #316
parent f1b355f7
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment