hopefully fixed CardInfoPopup freeze
This commit is contained in:
parent
04a96be84a
commit
15ca28bf37
3 changed files with 6 additions and 3 deletions
|
@ -212,6 +212,9 @@ void AbstractCardItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||
|
||||
void AbstractCardItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::MidButton)
|
||||
emit deleteCardInfoPopup();
|
||||
|
||||
// This function ensures the parent function doesn't mess around with our selection.
|
||||
event->accept();
|
||||
}
|
||||
|
|
|
@ -572,6 +572,7 @@ void MessageLogWidget::mousePressEvent(QMouseEvent *event)
|
|||
|
||||
void MessageLogWidget::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::MidButton)
|
||||
emit deleteCardInfoPopup();
|
||||
|
||||
QTextEdit::mouseReleaseEvent(event);
|
||||
|
|
|
@ -783,7 +783,7 @@ Player *TabGame::getActiveLocalPlayer() const
|
|||
void TabGame::showCardInfoPopup(const QPoint &pos, const QString &cardName)
|
||||
{
|
||||
infoPopup = new CardInfoWidget(CardInfoWidget::ModePopUp, 0, Qt::Widget | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint);
|
||||
connect(infoPopup, SIGNAL(mouseReleased()), this, SLOT(deleteCardInfoPopup()));
|
||||
infoPopup->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||
infoPopup->setCard(cardName);
|
||||
QRect screenRect = qApp->desktop()->screenGeometry(this);
|
||||
infoPopup->show();
|
||||
|
@ -791,7 +791,6 @@ void TabGame::showCardInfoPopup(const QPoint &pos, const QString &cardName)
|
|||
qMax(screenRect.left(), qMin(pos.x() - infoPopup->width() / 2, screenRect.left() + screenRect.width() - infoPopup->width())),
|
||||
qMax(screenRect.top(), qMin(pos.y() - infoPopup->height() / 2, screenRect.top() + screenRect.height() - infoPopup->height()))
|
||||
);
|
||||
infoPopup->grabMouse();
|
||||
}
|
||||
|
||||
void TabGame::deleteCardInfoPopup()
|
||||
|
|
Loading…
Reference in a new issue