Fix clicking on room list suggestions
2 files changed, 14 insertions, 4 deletions
diff --git a/include/QuickSwitcher.h b/include/QuickSwitcher.h
index ce0ed00b..ce3c4f25 100644
--- a/include/QuickSwitcher.h
+++ b/include/QuickSwitcher.h
@@ -63,6 +63,12 @@ protected:
void paintEvent(QPaintEvent *event) override;
private:
+ void reset()
+ {
+ emit closing();
+ roomSearch_->clear();
+ }
+
// Current highlighted selection from the completer.
int selection_ = -1;
diff --git a/include/SuggestionsPopup.hpp b/include/SuggestionsPopup.hpp
index e949ce7c..ba3aebe5 100644
--- a/include/SuggestionsPopup.hpp
+++ b/include/SuggestionsPopup.hpp
@@ -32,19 +32,17 @@ public:
protected:
void paintEvent(QPaintEvent *event) override;
- void mousePressEvent(QMouseEvent *event) override;
signals:
void clicked(const QString &text);
protected:
QHBoxLayout *topLayout_;
-
Avatar *avatar_;
-
QColor hoverColor_;
- //! Set if the item is currently being hovered during tab completion (cycling).
+ //! Set if the item is currently being
+ //! hovered during tab completion (cycling).
bool hovering_;
};
@@ -56,6 +54,9 @@ public:
UserItem(QWidget *parent, const QString &user_id);
QString selectedText() const { return userId_; }
+protected:
+ void mousePressEvent(QMouseEvent *event) override;
+
private:
QLabel *userName_;
QString userId_;
@@ -69,6 +70,9 @@ public:
RoomItem(QWidget *parent, const RoomSearchResult &res);
QString selectedText() const { return roomId_; }
+protected:
+ void mousePressEvent(QMouseEvent *event) override;
+
private:
QLabel *roomName_;
QString roomId_;
|