mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-25 16:32:36 -05:00
[VDE] Add shortcut to increment cards [Alt + LMB] (#6555)
Took 13 minutes Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
2b372c14e4
commit
ffc55aff10
|
|
@ -156,23 +156,32 @@ void TabDeckEditorVisual::processMainboardCardClick(QMouseEvent *event,
|
|||
QItemSelectionModel *sel = deckDockWidget->getSelectionModel();
|
||||
|
||||
// Double click = swap
|
||||
if (event->type() == QEvent::MouseButtonDblClick && event->button() == Qt::LeftButton) {
|
||||
if (event->type() == QEvent::MouseButtonDblClick && event->button() == Qt::LeftButton &&
|
||||
!event->modifiers().testFlag(Qt::AltModifier)) {
|
||||
deckStateManager->swapCardAtIndex(idx);
|
||||
idx = deckStateManager->getModel()->findCard(card.getName(), zoneName);
|
||||
sel->setCurrentIndex(idx, QItemSelectionModel::ClearAndSelect);
|
||||
return;
|
||||
}
|
||||
|
||||
// Right-click = decrement
|
||||
if (event->button() == Qt::RightButton) {
|
||||
actDecrementCard(card);
|
||||
// Alt + Right-click = decrement
|
||||
if (event->button() == Qt::RightButton && event->modifiers().testFlag(Qt::AltModifier)) {
|
||||
if (zoneName == DECK_ZONE_MAIN) {
|
||||
actDecrementCard(card);
|
||||
} else {
|
||||
actDecrementCardFromSideboard(card);
|
||||
}
|
||||
// Keep selection intact.
|
||||
return;
|
||||
}
|
||||
|
||||
// Alt + Left click = increment
|
||||
if (event->button() == Qt::LeftButton && event->modifiers().testFlag(Qt::AltModifier)) {
|
||||
// actIncrementCard(card);
|
||||
if (zoneName == DECK_ZONE_MAIN) {
|
||||
actAddCard(card);
|
||||
} else {
|
||||
actAddCardToSideboard(card);
|
||||
}
|
||||
// Keep selection intact.
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user