summary refs log tree commit diff
path: root/src/QuickSwitcher.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-05-03 15:19:28 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-05-03 15:19:28 +0300
commitd6ac72ab3fa0e7e350751c60873a925f98216b76 (patch)
treec46e501211df9e75c9e5483a5caee346a80bc745 /src/QuickSwitcher.cc
parentAdd missing header (diff)
downloadnheko-d6ac72ab3fa0e7e350751c60873a925f98216b76.tar.xz
Default to the first item in room selection menu
- Add backwards navigation with backtab

fixes #316
Diffstat (limited to 'src/QuickSwitcher.cc')
-rw-r--r--src/QuickSwitcher.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/QuickSwitcher.cc b/src/QuickSwitcher.cc

index 3596a8c4..2aa05f3c 100644 --- a/src/QuickSwitcher.cc +++ b/src/QuickSwitcher.cc
@@ -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