mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-12 15:49:28 -08:00
[DeckEditor] Expand DeckDock TreeView when adding card through deck editor (#6388)
* [DeckEditor] Expand DeckDock TreeView when adding card through deck editor * [DeckEditor] Expand first, then set selection.
This commit is contained in:
@@ -69,6 +69,7 @@ public slots:
|
|||||||
void actSwapCard();
|
void actSwapCard();
|
||||||
void actRemoveCard();
|
void actRemoveCard();
|
||||||
void offsetCountAtIndex(const QModelIndex &idx, int offset);
|
void offsetCountAtIndex(const QModelIndex &idx, int offset);
|
||||||
|
void expandAll();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void nameChanged();
|
void nameChanged();
|
||||||
@@ -117,7 +118,6 @@ private slots:
|
|||||||
void updateShowBannerCardComboBox(bool visible);
|
void updateShowBannerCardComboBox(bool visible);
|
||||||
void updateShowTagsWidget(bool visible);
|
void updateShowTagsWidget(bool visible);
|
||||||
void syncBannerCardComboBoxSelectionWithDeck();
|
void syncBannerCardComboBoxSelectionWithDeck();
|
||||||
void expandAll();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DECK_EDITOR_DECK_DOCK_WIDGET_H
|
#endif // DECK_EDITOR_DECK_DOCK_WIDGET_H
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ void AbstractTabDeckEditor::addCardHelper(const ExactCard &card, QString zoneNam
|
|||||||
card.getPrinting().getProperty("num")));
|
card.getPrinting().getProperty("num")));
|
||||||
|
|
||||||
QModelIndex newCardIndex = deckDockWidget->deckModel->addCard(card, zoneName);
|
QModelIndex newCardIndex = deckDockWidget->deckModel->addCard(card, zoneName);
|
||||||
|
deckDockWidget->expandAll();
|
||||||
deckDockWidget->deckView->clearSelection();
|
deckDockWidget->deckView->clearSelection();
|
||||||
deckDockWidget->deckView->setCurrentIndex(newCardIndex);
|
deckDockWidget->deckView->setCurrentIndex(newCardIndex);
|
||||||
setModified(true);
|
setModified(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user