mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Click tag mentions
You can now click on a username in the main chat to add a "@username" tag to the chat. Makes communication with other users using tags faster.
This commit is contained in:
parent
9b7f488bd7
commit
45112e49b1
4 changed files with 14 additions and 4 deletions
|
|
@ -249,12 +249,15 @@ void ChatView::mousePressEvent(QMouseEvent *event)
|
|||
break;
|
||||
}
|
||||
case HoveredUser: {
|
||||
if (event->button() == Qt::RightButton) {
|
||||
if (event->button() != Qt::MidButton) {
|
||||
const int delimiterIndex = hoveredContent.indexOf("_");
|
||||
UserLevelFlags userLevel(hoveredContent.left(delimiterIndex).toInt());
|
||||
const QString userName = hoveredContent.mid(delimiterIndex + 1);
|
||||
|
||||
userContextMenu->showContextMenu(event->globalPos(), userName, userLevel);
|
||||
if (event->button() == Qt::RightButton) {
|
||||
UserLevelFlags userLevel(hoveredContent.left(delimiterIndex).toInt());
|
||||
userContextMenu->showContextMenu(event->globalPos(), userName, userLevel);
|
||||
}
|
||||
else if (event->button() == Qt::LeftButton)
|
||||
emit addMentionTag("@" + userName);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue