[VDE] Add shortcut to increment cards [Alt + LMB]

Took 13 minutes
This commit is contained in:
Lukas Brübach 2026-01-24 11:06:33 +01:00
parent 948ec9e042
commit 890c765900

View file

@ -163,23 +163,32 @@ void TabDeckEditorVisual::processMainboardCardClick(QMouseEvent *event,
QItemSelectionModel *sel = deckDockWidget->getSelectionModel(); QItemSelectionModel *sel = deckDockWidget->getSelectionModel();
// Double click = swap // 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); deckStateManager->swapCardAtIndex(idx);
idx = deckStateManager->getModel()->findCard(card.getName(), zoneName); idx = deckStateManager->getModel()->findCard(card.getName(), zoneName);
sel->setCurrentIndex(idx, QItemSelectionModel::ClearAndSelect); sel->setCurrentIndex(idx, QItemSelectionModel::ClearAndSelect);
return; return;
} }
// Right-click = decrement // Alt + Right-click = decrement
if (event->button() == Qt::RightButton) { if (event->button() == Qt::RightButton && event->modifiers().testFlag(Qt::AltModifier)) {
if (zoneName == DECK_ZONE_MAIN) {
actDecrementCard(card); actDecrementCard(card);
} else {
actDecrementCardFromSideboard(card);
}
// Keep selection intact. // Keep selection intact.
return; return;
} }
// Alt + Left click = increment // Alt + Left click = increment
if (event->button() == Qt::LeftButton && event->modifiers().testFlag(Qt::AltModifier)) { 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. // Keep selection intact.
return; return;
} }