mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 00:42:14 -07:00
maintain old reselecting behavior when changing cards from left side
This commit is contained in:
parent
d4aff201bf
commit
58042ad9fe
1 changed files with 7 additions and 2 deletions
|
|
@ -1252,6 +1252,7 @@ void TabDeckEditor::addCardHelper(QString zoneName)
|
||||||
|
|
||||||
QModelIndex newCardIndex = deckModel->addPreferredPrintingCard(info->getName(), zoneName, false);
|
QModelIndex newCardIndex = deckModel->addPreferredPrintingCard(info->getName(), zoneName, false);
|
||||||
recursiveExpand(newCardIndex);
|
recursiveExpand(newCardIndex);
|
||||||
|
deckView->clearSelection();
|
||||||
deckView->setCurrentIndex(newCardIndex);
|
deckView->setCurrentIndex(newCardIndex);
|
||||||
setModified(true);
|
setModified(true);
|
||||||
searchEdit->setSelection(0, searchEdit->text().length());
|
searchEdit->setSelection(0, searchEdit->text().length());
|
||||||
|
|
@ -1338,14 +1339,18 @@ void TabDeckEditor::offsetCountAtIndex(const QModelIndex &idx, int offset)
|
||||||
void TabDeckEditor::decrementCardHelper(QString zoneName)
|
void TabDeckEditor::decrementCardHelper(QString zoneName)
|
||||||
{
|
{
|
||||||
const CardInfoPtr info = currentCardInfo();
|
const CardInfoPtr info = currentCardInfo();
|
||||||
QModelIndex idx;
|
|
||||||
|
|
||||||
if (!info)
|
if (!info)
|
||||||
return;
|
return;
|
||||||
if (info->getIsToken())
|
if (info->getIsToken())
|
||||||
zoneName = DECK_ZONE_TOKENS;
|
zoneName = DECK_ZONE_TOKENS;
|
||||||
|
|
||||||
idx = deckModel->findCard(info->getName(), zoneName);
|
QModelIndex idx = deckModel->findCard(info->getName(), zoneName);
|
||||||
|
if (!idx.isValid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
deckView->clearSelection();
|
||||||
|
deckView->setCurrentIndex(idx);
|
||||||
offsetCountAtIndex(idx, -1);
|
offsetCountAtIndex(idx, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue