From bcdd97c85fb3b2aeb0cd46c05562f880792737aa Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Mon, 19 Aug 2019 18:11:38 -0400 Subject: More updates to mentions functionality --- src/popups/UserMentions.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/popups/UserMentions.cpp') diff --git a/src/popups/UserMentions.cpp b/src/popups/UserMentions.cpp index 267540cc..152cd82d 100644 --- a/src/popups/UserMentions.cpp +++ b/src/popups/UserMentions.cpp @@ -3,6 +3,7 @@ #include "Cache.h" #include "ChatPage.h" +#include "Logging.h" #include "UserMentions.h" #include "timeline/TimelineItem.h" @@ -12,7 +13,7 @@ UserMentions::UserMentions(QWidget *parent) : QWidget{parent} { setAttribute(Qt::WA_ShowWithoutActivating, true); - setWindowFlags(Qt::ToolTip | Qt::NoDropShadowWindowHint); + setWindowFlags(Qt::FramelessWindowHint | Qt::Popup); tab_layout_ = new QTabWidget(this); @@ -66,12 +67,7 @@ void UserMentions::initializeMentions(const QMap ¬ifs) { nhlog::ui()->debug("Initializing " + std::to_string(notifs.size()) + " notifications."); - for (auto widget : all_scroll_layout_->findChildren()) { - delete widget; - } - for (auto widget : local_scroll_layout_->findChildren()) { - delete widget; - } + for (const auto &item : notifs) { for (const auto notif : item.notifications) { const auto event_id = QString::fromStdString(utils::event_id(notif.event)); @@ -98,10 +94,16 @@ UserMentions::initializeMentions(const QMapfindChildren()) { + delete widget; + } + for (auto widget : local_scroll_layout_->findChildren()) { + delete widget; + } + auto notifs = cache::client()->getTimelineMentions(); initializeMentions(notifs); - show(); } -- cgit 1.5.1