mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 04:58:49 +03:00
Default to the first item in room selection menu
- Add backwards navigation with backtab fixes #316
This commit is contained in:
parent
f1b355f7a7
commit
d6ac72ab3f
2 changed files with 15 additions and 6 deletions
|
@ -31,18 +31,23 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
RoomSearchInput::hideEvent(QHideEvent *event)
|
||||
|
|
|
@ -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…
Reference in a new issue