Add a button to swap the card between mainboard and sideboard to the deck editor.

This commit is contained in:
Lukas Brübach 2024-11-16 11:58:03 +01:00
parent 38e99f2e87
commit e710f7619f
3 changed files with 20 additions and 1 deletions

View file

@ -113,6 +113,12 @@ void TabDeckEditor::createDeckDock()
auto *tbRemoveCard = new QToolButton(this);
tbRemoveCard->setDefaultAction(aRemoveCard);
aSwapCard = new QAction(QString(), this);
aSwapCard->setIcon(QPixmap("theme:icons/swap"));
connect(aSwapCard, SIGNAL(triggered()), this, SLOT(actSwapCard()));
auto *tbSwapCard = new QToolButton(this);
tbSwapCard->setDefaultAction(aSwapCard);
auto *upperLayout = new QGridLayout;
upperLayout->setObjectName("upperLayout");
upperLayout->addWidget(nameLabel, 0, 0);
@ -138,6 +144,7 @@ void TabDeckEditor::createDeckDock()
lowerLayout->addWidget(tbIncrement, 0, 2);
lowerLayout->addWidget(tbDecrement, 0, 3);
lowerLayout->addWidget(tbRemoveCard, 0, 4);
lowerLayout->addWidget(tbSwapCard, 0, 5);
lowerLayout->addWidget(deckView, 1, 0, 1, 5);
// Create widgets for both layouts to make splitter work correctly

View file

@ -142,7 +142,7 @@ private:
*aSaveDeckToClipboard, *aSaveDeckToClipboardRaw, *aPrintDeck, *aExportDeckDecklist, *aAnalyzeDeckDeckstats,
*aAnalyzeDeckTappedout, *aClose;
QAction *aClearFilterAll, *aClearFilterOne;
QAction *aAddCard, *aAddCardToSideboard, *aRemoveCard, *aIncrement, *aDecrement;
QAction *aAddCard, *aAddCardToSideboard, *aRemoveCard, *aIncrement, *aDecrement, *aSwapCard;
QAction *aResetLayout;
QAction *aCardInfoDockVisible, *aCardInfoDockFloating, *aDeckDockVisible, *aDeckDockFloating, *aFilterDockVisible,
*aFilterDockFloating, *aPrintingSelectorDockVisible, *aPrintingSelectorDockFloating;