From 4fd8eccecec1dea7f7c7095d11e15fc0c2474b9f Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Tue, 24 Apr 2018 16:03:50 +0300 Subject: Adjust completion menu to fit its contents --- src/SuggestionsPopup.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/SuggestionsPopup.cpp') 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 &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); +} -- cgit 1.5.1