Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
15ca28bf
Commit
15ca28bf
authored
May 30, 2011
by
Max-Wilhelm Bruker
Browse files
hopefully fixed CardInfoPopup freeze
parent
04a96be8
Changes
3
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/abstractcarditem.cpp
View file @
15ca28bf
...
@@ -212,6 +212,9 @@ void AbstractCardItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
...
@@ -212,6 +212,9 @@ void AbstractCardItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
void
AbstractCardItem
::
mouseReleaseEvent
(
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.
// This function ensures the parent function doesn't mess around with our selection.
event
->
accept
();
event
->
accept
();
}
}
...
...
cockatrice/src/messagelogwidget.cpp
View file @
15ca28bf
...
@@ -572,7 +572,8 @@ void MessageLogWidget::mousePressEvent(QMouseEvent *event)
...
@@ -572,7 +572,8 @@ void MessageLogWidget::mousePressEvent(QMouseEvent *event)
void
MessageLogWidget
::
mouseReleaseEvent
(
QMouseEvent
*
event
)
void
MessageLogWidget
::
mouseReleaseEvent
(
QMouseEvent
*
event
)
{
{
emit
deleteCardInfoPopup
();
if
(
event
->
button
()
==
Qt
::
MidButton
)
emit
deleteCardInfoPopup
();
QTextEdit
::
mouseReleaseEvent
(
event
);
QTextEdit
::
mouseReleaseEvent
(
event
);
}
}
cockatrice/src/tab_game.cpp
View file @
15ca28bf
...
@@ -783,7 +783,7 @@ Player *TabGame::getActiveLocalPlayer() const
...
@@ -783,7 +783,7 @@ Player *TabGame::getActiveLocalPlayer() const
void
TabGame
::
showCardInfoPopup
(
const
QPoint
&
pos
,
const
QString
&
cardName
)
void
TabGame
::
showCardInfoPopup
(
const
QPoint
&
pos
,
const
QString
&
cardName
)
{
{
infoPopup
=
new
CardInfoWidget
(
CardInfoWidget
::
ModePopUp
,
0
,
Qt
::
Widget
|
Qt
::
FramelessWindowHint
|
Qt
::
X11BypassWindowManagerHint
|
Qt
::
WindowStaysOnTopHint
);
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
);
infoPopup
->
setCard
(
cardName
);
QRect
screenRect
=
qApp
->
desktop
()
->
screenGeometry
(
this
);
QRect
screenRect
=
qApp
->
desktop
()
->
screenGeometry
(
this
);
infoPopup
->
show
();
infoPopup
->
show
();
...
@@ -791,7 +791,6 @@ void TabGame::showCardInfoPopup(const QPoint &pos, const QString &cardName)
...
@@ -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
.
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
()))
qMax
(
screenRect
.
top
(),
qMin
(
pos
.
y
()
-
infoPopup
->
height
()
/
2
,
screenRect
.
top
()
+
screenRect
.
height
()
-
infoPopup
->
height
()))
);
);
infoPopup
->
grabMouse
();
}
}
void
TabGame
::
deleteCardInfoPopup
()
void
TabGame
::
deleteCardInfoPopup
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment