mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
arrows: clean all arrows when changing phase; arrow color dependent on modifier keys; remove a single arrow by rightclicking
This commit is contained in:
parent
c57e138a78
commit
897dca2386
8 changed files with 58 additions and 11 deletions
|
|
@ -204,7 +204,16 @@ void CardItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
|||
if (event->buttons().testFlag(Qt::RightButton)) {
|
||||
if ((event->screenPos() - event->buttonDownScreenPos(Qt::RightButton)).manhattanLength() < 2 * QApplication::startDragDistance())
|
||||
return;
|
||||
ArrowDragItem *arrow = new ArrowDragItem(this);
|
||||
|
||||
QColor arrowColor = Qt::red;
|
||||
if (event->modifiers().testFlag(Qt::ControlModifier))
|
||||
arrowColor = Qt::yellow;
|
||||
else if (event->modifiers().testFlag(Qt::AltModifier))
|
||||
arrowColor = Qt::blue;
|
||||
else if (event->modifiers().testFlag(Qt::ShiftModifier))
|
||||
arrowColor = Qt::green;
|
||||
|
||||
ArrowDragItem *arrow = new ArrowDragItem(this, arrowColor);
|
||||
scene()->addItem(arrow);
|
||||
arrow->grabMouse();
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue