[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:
BruebachL 2026-01-24 11:28:06 +01:00 committed by GitHub
parent 2b372c14e4
commit ffc55aff10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}