summary refs log tree commit diff
path: root/src/popups/UserMentions.cpp
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2019-08-19 18:11:38 -0400
committerJoseph Donofry <joedonofry@gmail.com>2019-08-19 18:11:38 -0400
commitbcdd97c85fb3b2aeb0cd46c05562f880792737aa (patch)
treee4fb62482c5b93b6b7a6b0ed667620dada71dea0 /src/popups/UserMentions.cpp
parentFix issues with caching and loading of mentions. (diff)
downloadnheko-bcdd97c85fb3b2aeb0cd46c05562f880792737aa.tar.xz
More updates to mentions functionality
Diffstat (limited to 'src/popups/UserMentions.cpp')
-rw-r--r--src/popups/UserMentions.cpp18
1 files changed, 10 insertions, 8 deletions
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<QString, mtx::responses::Notifications> &notifs) { nhlog::ui()->debug("Initializing " + std::to_string(notifs.size()) + " notifications."); - for (auto widget : all_scroll_layout_->findChildren<QWidget *>()) { - delete widget; - } - for (auto widget : local_scroll_layout_->findChildren<QWidget *>()) { - 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 QMap<QString, mtx::responses::Notificatio void UserMentions::showPopup() { + for (auto widget : all_scroll_layout_->findChildren<QWidget *>()) { + delete widget; + } + for (auto widget : local_scroll_layout_->findChildren<QWidget *>()) { + delete widget; + } + auto notifs = cache::client()->getTimelineMentions(); initializeMentions(notifs); - show(); }