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
a28eb053
Commit
a28eb053
authored
Nov 21, 2014
by
ctrlaltca
Browse files
Merge pull request #450 from poixen/ghostcards
Added fade to card drag items
parents
68bc67cd
141d0c76
Changes
1
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/abstractcarddragitem.cpp
View file @
a28eb053
...
...
@@ -3,9 +3,11 @@
#include
<QCursor>
#include
<QGraphicsSceneMouseEvent>
#include
<QDebug>
#include
<QPainter>
static
const
float
CARD_WIDTH_HALF
=
CARD_WIDTH
/
2
;
static
const
float
CARD_HEIGHT_HALF
=
CARD_HEIGHT
/
2
;
const
QColor
GHOST_MASK
=
QColor
(
255
,
255
,
255
,
50
);
AbstractCardDragItem
::
AbstractCardDragItem
(
AbstractCardItem
*
_item
,
const
QPointF
&
_hotSpot
,
AbstractCardDragItem
*
parentDrag
)
:
QGraphicsItem
(),
item
(
_item
),
hotSpot
(
_hotSpot
)
...
...
@@ -40,6 +42,9 @@ AbstractCardDragItem::~AbstractCardDragItem()
void
AbstractCardDragItem
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
)
{
item
->
paint
(
painter
,
option
,
widget
);
// adds a mask to the card so it looks like the card hasnt been placed yet
painter
->
fillRect
(
boundingRect
(),
GHOST_MASK
);
}
void
AbstractCardDragItem
::
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
)
...
...
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