summary refs log tree commit diff
path: root/src/SuggestionsPopup.cpp
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-04-24 16:03:50 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-04-24 16:03:50 +0300
commit4fd8eccecec1dea7f7c7095d11e15fc0c2474b9f (patch)
tree3b9f14ff667bf13d5732c3f502a6c5944d189231 /src/SuggestionsPopup.cpp
parentClear typing notifications when the user list is empty (diff)
downloadnheko-4fd8eccecec1dea7f7c7095d11e15fc0c2474b9f.tar.xz
Adjust completion menu to fit its contents
Diffstat (limited to 'src/SuggestionsPopup.cpp')
-rw-r--r--src/SuggestionsPopup.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/SuggestionsPopup.cpp b/src/SuggestionsPopup.cpp
index e7011fcb..49495e71 100644
--- a/src/SuggestionsPopup.cpp
+++ b/src/SuggestionsPopup.cpp
@@ -106,6 +106,7 @@ SuggestionsPopup::addUsers(const QVector<SearchResult> &users)
         }
 
         resetSelection();
+        adjustSize();
 
         resize(geometry().width(), 40 * users.size());
 }
@@ -171,3 +172,12 @@ SuggestionsPopup::selectHoveredSuggestion()
 
         resetSelection();
 }
+
+void
+SuggestionsPopup::paintEvent(QPaintEvent *)
+{
+        QStyleOption opt;
+        opt.init(this);
+        QPainter p(this);
+        style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
+}