diff --git a/src/popups/UserMentions.cpp b/src/popups/UserMentions.cpp
index 152cd82d..3480959a 100644
--- a/src/popups/UserMentions.cpp
+++ b/src/popups/UserMentions.cpp
@@ -1,3 +1,5 @@
+#include <QPainter>
+#include <QStyleOption>
#include <QTabWidget>
#include <QTimer>
@@ -140,7 +142,6 @@ UserMentions::pushItem(const QString &event_id,
local_scroll_widget_);
local_view_item->setEventId(event_id);
local_view_item->hide();
-
local_scroll_layout_->addWidget(local_view_item);
QTimer::singleShot(0, this, [local_view_item]() {
@@ -148,4 +149,13 @@ UserMentions::pushItem(const QString &event_id,
local_view_item->adjustSize();
});
}
+}
+
+void
+UserMentions::paintEvent(QPaintEvent *)
+{
+ QStyleOption opt;
+ opt.init(this);
+ QPainter p(this);
+ style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
\ No newline at end of file
diff --git a/src/popups/UserMentions.h b/src/popups/UserMentions.h
index a74bf2ec..d7dfc575 100644
--- a/src/popups/UserMentions.h
+++ b/src/popups/UserMentions.h
@@ -5,6 +5,7 @@
#include <QApplication>
#include <QEvent>
#include <QMap>
+#include <QPaintEvent>
#include <QScrollArea>
#include <QScrollBar>
#include <QString>
@@ -26,6 +27,9 @@ public:
void initializeMentions(const QMap<QString, mtx::responses::Notifications> ¬ifs);
void showPopup();
+protected:
+ void paintEvent(QPaintEvent *) override;
+
private:
void pushItem(const QString &event_id,
const QString &user_id,
|