summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-08-20 21:13:00 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-08-20 21:13:00 +0300
commitc6ec20fa402d29f97cad37000a253366758bb56a (patch)
tree3c2c051ff7dde249a2a6e16cc9dcdff2f6641368 /include
parentSmall style change (diff)
downloadnheko-c6ec20fa402d29f97cad37000a253366758bb56a.tar.xz
Place the completion popup under the search widget
Diffstat (limited to 'include')
-rw-r--r--include/QuickSwitcher.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/QuickSwitcher.h b/include/QuickSwitcher.h

index 1f4c8835..6a7875f9 100644 --- a/include/QuickSwitcher.h +++ b/include/QuickSwitcher.h
@@ -17,6 +17,7 @@ #pragma once +#include <QAbstractItemView> #include <QFrame> #include <QKeyEvent> #include <QVBoxLayout> @@ -29,8 +30,14 @@ class RoomSearchInput : public TextField public: explicit RoomSearchInput(QWidget *parent = nullptr); +signals: + void selectNextCompletion(); + void selectPreviousCompletion(); + void hiding(); + protected: void keyPressEvent(QKeyEvent *event) override; + void hideEvent(QHideEvent *event) override; bool focusNextPrevChild(bool next) override; }; @@ -51,8 +58,12 @@ protected: void showEvent(QShowEvent *event) override; private: + // Current highlighted selection from the completer. + int selection_ = -1; + QVBoxLayout *topLayout_; RoomSearchInput *roomSearch_; + QCompleter *completer_; QMap<QString, QString> rooms_; };