Added right-click on nickname to reply on whisper. (#680)

This commit is contained in:
23rd
2018-08-26 11:42:00 +03:00
committed by pajlada
parent 70199e00d2
commit ce155299e9
3 changed files with 13 additions and 5 deletions
+11 -4
View File
@@ -1033,12 +1033,18 @@ void ChannelView::handleMouseClick(QMouseEvent *event,
}
} break;
case Qt::RightButton: {
auto insertText = [=](QString text) {
if (auto split = dynamic_cast<Split *>(this->parentWidget())) {
split->insertTextToInput(text);
}
};
auto &link = hoveredElement->getLink();
if (link.type == Link::UserInfo) {
Split *split = dynamic_cast<Split *>(this->parentWidget());
if (split != nullptr) {
split->insertTextToInput("@" + link.value + ", ");
}
insertText("@" + link.value + ", ");
} else if (link.type == Link::UserWhisper) {
insertText("/w " + link.value + " ");
} else {
this->addContextMenuItems(hoveredElement, layout);
}
@@ -1155,6 +1161,7 @@ void ChannelView::handleLinkClick(QMouseEvent *event, const Link &link,
}
switch (link.type) {
case Link::UserWhisper:
case Link::UserInfo: {
auto user = link.value;