fix: UserInfoPopup now requires a split as its parent (#5034)
Co-authored-by: Nerixyz <nerixdev@outlook.de>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include "UserInfoPopup.hpp"
|
||||
#include "widgets/dialogs/UserInfoPopup.hpp"
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "common/Channel.hpp"
|
||||
@@ -134,9 +134,8 @@ namespace {
|
||||
|
||||
} // namespace
|
||||
|
||||
UserInfoPopup::UserInfoPopup(bool closeAutomatically, QWidget *parent,
|
||||
Split *split)
|
||||
: DraggablePopup(closeAutomatically, parent)
|
||||
UserInfoPopup::UserInfoPopup(bool closeAutomatically, Split *split)
|
||||
: DraggablePopup(closeAutomatically, split)
|
||||
, split_(split)
|
||||
, closeAutomatically_(closeAutomatically)
|
||||
{
|
||||
|
||||
@@ -23,8 +23,11 @@ class UserInfoPopup final : public DraggablePopup
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
UserInfoPopup(bool closeAutomatically, QWidget *parent,
|
||||
Split *split = nullptr);
|
||||
/**
|
||||
* @param closeAutomatically Decides whether the popup should close when it loses focus
|
||||
* @param split Will be used as the popup's parent. Must not be null
|
||||
*/
|
||||
UserInfoPopup(bool closeAutomatically, Split *split);
|
||||
|
||||
void setData(const QString &name, const ChannelPtr &channel);
|
||||
void setData(const QString &name, const ChannelPtr &contextChannel,
|
||||
|
||||
@@ -2580,10 +2580,9 @@ void ChannelView::hideEvent(QHideEvent * /*event*/)
|
||||
void ChannelView::showUserInfoPopup(const QString &userName,
|
||||
QString alternativePopoutChannel)
|
||||
{
|
||||
auto *userCardParent =
|
||||
static_cast<QWidget *>(&(getApp()->windows->getMainWindow()));
|
||||
auto *userPopup = new UserInfoPopup(getSettings()->autoCloseUserPopup,
|
||||
userCardParent, this->split_);
|
||||
assert(this->split_ != nullptr);
|
||||
auto *userPopup =
|
||||
new UserInfoPopup(getSettings()->autoCloseUserPopup, this->split_);
|
||||
|
||||
auto contextChannel =
|
||||
getApp()->twitch->getChannelOrEmpty(alternativePopoutChannel);
|
||||
|
||||
Reference in New Issue
Block a user