Delete emote popup when it is closed.
This commit is contained in:
@@ -100,8 +100,8 @@ namespace {
|
||||
}
|
||||
} // namespace
|
||||
|
||||
EmotePopup::EmotePopup()
|
||||
: BaseWindow(nullptr, BaseWindow::EnableCustomFrame)
|
||||
EmotePopup::EmotePopup(QWidget *parent)
|
||||
: BaseWindow(parent, BaseWindow::EnableCustomFrame)
|
||||
{
|
||||
auto layout = new QVBoxLayout(this);
|
||||
this->getLayoutContainer()->setLayout(layout);
|
||||
|
||||
@@ -14,7 +14,7 @@ using ChannelPtr = std::shared_ptr<Channel>;
|
||||
class EmotePopup : public BaseWindow
|
||||
{
|
||||
public:
|
||||
EmotePopup();
|
||||
EmotePopup(QWidget *parent = nullptr);
|
||||
|
||||
void loadChannel(ChannelPtr channel);
|
||||
void loadEmojis();
|
||||
|
||||
@@ -153,7 +153,9 @@ void SplitInput::openEmotePopup()
|
||||
{
|
||||
if (!this->emotePopup_)
|
||||
{
|
||||
this->emotePopup_ = std::make_unique<EmotePopup>();
|
||||
this->emotePopup_ = new EmotePopup(this);
|
||||
this->emotePopup_->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
this->emotePopup_->linkClicked.connect([this](const Link &link) {
|
||||
if (link.type == Link::InsertText)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "util/QObjectRef.hpp"
|
||||
#include "widgets/BaseWidget.hpp"
|
||||
|
||||
#include <QHBoxLayout>
|
||||
@@ -46,7 +47,7 @@ private:
|
||||
void openEmotePopup();
|
||||
|
||||
Split *const split_;
|
||||
std::shared_ptr<EmotePopup> emotePopup_;
|
||||
QObjectRef<EmotePopup> emotePopup_;
|
||||
|
||||
struct {
|
||||
ResizingTextEdit *textEdit;
|
||||
|
||||
Reference in New Issue
Block a user