Popup improvements
- ESC closes the popup. - Up/Down arrows for navigation. - BackTab for backwards navigation. fixes #301 fixes #302
This commit is contained in:
parent
96617385bc
commit
ca66940ec3
4 changed files with 72 additions and 26 deletions
|
|
@ -62,15 +62,27 @@ public:
|
|||
|
||||
public slots:
|
||||
void addUsers(const QVector<SearchResult> &users);
|
||||
void cycleThroughSuggestions();
|
||||
void selectHoveredSuggestion();
|
||||
//! Move to the next available suggestion item.
|
||||
void selectNextSuggestion();
|
||||
//! Move to the previous available suggestion item.
|
||||
void selectPreviousSuggestion();
|
||||
//! Remove hovering from all items.
|
||||
void resetHovering();
|
||||
//! Set hovering to the item in the given layout position.
|
||||
void setHovering(int pos);
|
||||
|
||||
signals:
|
||||
void itemSelected(const QString &user);
|
||||
|
||||
private:
|
||||
void hoverSelection();
|
||||
void resetSelection() { selectedItem_ = -1; }
|
||||
void selectFirstItem() { selectedItem_ = 0; }
|
||||
void selectLastItem() { selectedItem_ = layout_->count() - 1; }
|
||||
|
||||
QVBoxLayout *layout_;
|
||||
|
||||
//! Counter for tab completion (cycling).
|
||||
int tab_clicks_;
|
||||
int selectedItem_ = -1;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -73,7 +73,8 @@ signals:
|
|||
//! Trigger the suggestion popup.
|
||||
void showSuggestions(const QString &query);
|
||||
void resultsRetrieved(const QVector<SearchResult> &results);
|
||||
void cycleSuggestions();
|
||||
void selectNextSuggestion();
|
||||
void selectPreviousSuggestion();
|
||||
void selectHoveredSuggestion();
|
||||
|
||||
public slots:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue