mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
show hand context menu when hand counter is rightclicked
This commit is contained in:
parent
683c57bb88
commit
3211801e39
5 changed files with 26 additions and 3 deletions
|
|
@ -86,13 +86,21 @@ void CardZone::mouseDoubleClickEvent(QGraphicsSceneMouseEvent */*event*/)
|
|||
doubleClickAction->trigger();
|
||||
}
|
||||
|
||||
bool CardZone::showContextMenu(const QPoint &screenPos)
|
||||
{
|
||||
if (menu) {
|
||||
menu->exec(screenPos);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void CardZone::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::RightButton) {
|
||||
if (menu) {
|
||||
menu->exec(event->screenPos());
|
||||
if (showContextMenu(event->screenPos()))
|
||||
event->accept();
|
||||
} else
|
||||
else
|
||||
event->ignore();
|
||||
} else
|
||||
event->ignore();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue