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
2 changed files with 11 additions and 9 deletions
+10 -9
View File
@@ -1991,16 +1991,17 @@ void ChannelView::handleMouseClick(QMouseEvent *event,
}
break;
case Qt::RightButton: {
auto split = dynamic_cast<Split *>(this->parentWidget());
auto insertText = [=](QString text) {
if (split)
{
split->insertTextToInput(text);
}
};
if (hoveredElement != nullptr)
// insert user mention to input, only in default context
if ((this->context_ == Context::None) &&
(hoveredElement != nullptr))
{
auto split = dynamic_cast<Split *>(this->parentWidget());
auto insertText = [=](QString text) {
if (split)
{
split->insertTextToInput(text);
}
};
const auto &link = hoveredElement->getLink();
if (link.type == Link::UserInfo)