mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fix: UserInfoPopup now requires a split as its parent (#5034)
Co-authored-by: Nerixyz <nerixdev@outlook.de>
This commit is contained in:
parent
d016a16269
commit
aa11a24163
|
@ -51,6 +51,7 @@
|
|||
- 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 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: Fixes to section deletion in text input fields. (#5013)
|
||||
- Bugfix: Show user text input within watch streak notices. (#5029)
|
||||
|
|
|
@ -616,10 +616,8 @@ QString openUsercard(const CommandContext &ctx)
|
|||
"should be open.");
|
||||
}
|
||||
|
||||
auto *userPopup = new UserInfoPopup(
|
||||
getSettings()->autoCloseUserPopup,
|
||||
static_cast<QWidget *>(&(getApp()->windows->getMainWindow())),
|
||||
currentSplit);
|
||||
auto *userPopup =
|
||||
new UserInfoPopup(getSettings()->autoCloseUserPopup, currentSplit);
|
||||
userPopup->setData(userName, channel);
|
||||
userPopup->moveTo(QCursor::pos(), widgets::BoundsChecking::CursorPosition);
|
||||
userPopup->show();
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue