mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 16:44:48 -07:00
Added card hover + card info widget popup to MessageLogWidget
This commit is contained in:
parent
e1ad152f65
commit
cf95e5f328
6 changed files with 112 additions and 14 deletions
|
|
@ -183,21 +183,14 @@ void AbstractCardItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||
}
|
||||
if (event->button() == Qt::LeftButton)
|
||||
setCursor(Qt::ClosedHandCursor);
|
||||
else if (event->button() == Qt::MidButton) {
|
||||
infoWidget = new CardInfoWidget(CardInfoWidget::ModePopUp, 0, Qt::Widget | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint);
|
||||
infoWidget->setCard(this);
|
||||
infoWidget->move(event->screenPos().x() - infoWidget->width() / 2, event->screenPos().y() - infoWidget->height() / 2);
|
||||
infoWidget->show();
|
||||
}
|
||||
else if (event->button() == Qt::MidButton)
|
||||
emit showCardInfoPopup(event->screenPos(), name);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void AbstractCardItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (infoWidget) {
|
||||
infoWidget->deleteLater();
|
||||
infoWidget = 0;
|
||||
}
|
||||
emit deleteCardInfoPopup();
|
||||
}
|
||||
|
||||
void AbstractCardItem::processHoverEvent()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue