Fix context menu not opening when username is right clicked from usercard/search/reply window (#4122)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
kornes 2022-11-12 17:10:21 +00:00 committed by GitHub
parent 3ed7489e0f
commit 8fa89b4073
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 9 deletions

View file

@ -84,6 +84,7 @@
- Bugfix: Fixed `Add new account` dialog causing main chatterino window to be non movable. (#4121) - Bugfix: Fixed `Add new account` dialog causing main chatterino window to be non movable. (#4121)
- Bugfix: Connection to Twitch PubSub now recovers more reliably. (#3643, #3716) - Bugfix: Connection to Twitch PubSub now recovers more reliably. (#3643, #3716)
- Bugfix: Fixed `Smooth scrolling on new messages` setting sometimes hiding messages. (#4028) - Bugfix: Fixed `Smooth scrolling on new messages` setting sometimes hiding messages. (#4028)
- Bugfix: Fixed context menu not opening when username is right clicked from usercard/search/reply window. (#4122)
- Bugfix: Fixed a crash that can occur when closing and quickly reopening a split, then running a command. (#3852) - Bugfix: Fixed a crash that can occur when closing and quickly reopening a split, then running a command. (#3852)
- Bugfix: Fixed a crash that can occur when changing channels. (#3799) - Bugfix: Fixed a crash that can occur when changing channels. (#3799)
- Bugfix: Fixed viewers list search not working when used before loading finishes. (#3774) - Bugfix: Fixed viewers list search not working when used before loading finishes. (#3774)

View file

@ -1991,6 +1991,10 @@ void ChannelView::handleMouseClick(QMouseEvent *event,
} }
break; break;
case Qt::RightButton: { case Qt::RightButton: {
// insert user mention to input, only in default context
if ((this->context_ == Context::None) &&
(hoveredElement != nullptr))
{
auto split = dynamic_cast<Split *>(this->parentWidget()); auto split = dynamic_cast<Split *>(this->parentWidget());
auto insertText = [=](QString text) { auto insertText = [=](QString text) {
if (split) if (split)
@ -1998,9 +2002,6 @@ void ChannelView::handleMouseClick(QMouseEvent *event,
split->insertTextToInput(text); split->insertTextToInput(text);
} }
}; };
if (hoveredElement != nullptr)
{
const auto &link = hoveredElement->getLink(); const auto &link = hoveredElement->getLink();
if (link.type == Link::UserInfo) if (link.type == Link::UserInfo)