fix: UserInfoPopup now requires a split as its parent (#5034)

Co-authored-by: Nerixyz <nerixdev@outlook.de>
This commit is contained in:
pajlada 2023-12-17 12:53:06 +01:00 committed by GitHub
parent d016a16269
commit aa11a24163
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 14 deletions

View file

@ -51,6 +51,7 @@
- Bugfix: Hide the Usercard button in the User Info Popup when in special channels. (#4972) - Bugfix: Hide the Usercard button in the User Info Popup when in special channels. (#4972)
- Bugfix: Fixed support for Windows 11 Snap layouts. (#4994) - Bugfix: Fixed support for Windows 11 Snap layouts. (#4994)
- Bugfix: Fixed some windows appearing between screens. (#4797) - Bugfix: Fixed some windows appearing between screens. (#4797)
- Bugfix: Fixed a crash that could occur when using certain features in a Usercard after closing the split from which it was created. (#5034)
- Bugfix: Fixed a bug on Wayland where tooltips would spawn as separate windows instead of behaving like tooltips. (#4998) - Bugfix: Fixed a bug on Wayland where tooltips would spawn as separate windows instead of behaving like tooltips. (#4998)
- Bugfix: Fixes to section deletion in text input fields. (#5013) - Bugfix: Fixes to section deletion in text input fields. (#5013)
- Bugfix: Show user text input within watch streak notices. (#5029) - Bugfix: Show user text input within watch streak notices. (#5029)

View file

@ -616,10 +616,8 @@ QString openUsercard(const CommandContext &ctx)
"should be open."); "should be open.");
} }
auto *userPopup = new UserInfoPopup( auto *userPopup =
getSettings()->autoCloseUserPopup, new UserInfoPopup(getSettings()->autoCloseUserPopup, currentSplit);
static_cast<QWidget *>(&(getApp()->windows->getMainWindow())),
currentSplit);
userPopup->setData(userName, channel); userPopup->setData(userName, channel);
userPopup->moveTo(QCursor::pos(), widgets::BoundsChecking::CursorPosition); userPopup->moveTo(QCursor::pos(), widgets::BoundsChecking::CursorPosition);
userPopup->show(); userPopup->show();

View file

@ -1,4 +1,4 @@
#include "UserInfoPopup.hpp" #include "widgets/dialogs/UserInfoPopup.hpp"
#include "Application.hpp" #include "Application.hpp"
#include "common/Channel.hpp" #include "common/Channel.hpp"
@ -134,9 +134,8 @@ namespace {
} // namespace } // namespace
UserInfoPopup::UserInfoPopup(bool closeAutomatically, QWidget *parent, UserInfoPopup::UserInfoPopup(bool closeAutomatically, Split *split)
Split *split) : DraggablePopup(closeAutomatically, split)
: DraggablePopup(closeAutomatically, parent)
, split_(split) , split_(split)
, closeAutomatically_(closeAutomatically) , closeAutomatically_(closeAutomatically)
{ {

View file

@ -23,8 +23,11 @@ class UserInfoPopup final : public DraggablePopup
Q_OBJECT Q_OBJECT
public: 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 &channel);
void setData(const QString &name, const ChannelPtr &contextChannel, void setData(const QString &name, const ChannelPtr &contextChannel,

View file

@ -2580,10 +2580,9 @@ void ChannelView::hideEvent(QHideEvent * /*event*/)
void ChannelView::showUserInfoPopup(const QString &userName, void ChannelView::showUserInfoPopup(const QString &userName,
QString alternativePopoutChannel) QString alternativePopoutChannel)
{ {
auto *userCardParent = assert(this->split_ != nullptr);
static_cast<QWidget *>(&(getApp()->windows->getMainWindow())); auto *userPopup =
auto *userPopup = new UserInfoPopup(getSettings()->autoCloseUserPopup, new UserInfoPopup(getSettings()->autoCloseUserPopup, this->split_);
userCardParent, this->split_);
auto contextChannel = auto contextChannel =
getApp()->twitch->getChannelOrEmpty(alternativePopoutChannel); getApp()->twitch->getChannelOrEmpty(alternativePopoutChannel);