[DeckEditor] Restore auto-scroll when adding cards (#7317)

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-09-19 09:55:30 +02:00 • committed by GitHub
parent 51365960fe
commit 59dd052143
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -520,8 +520,11 @@ void DeckEditorDeckDockWidget::syncBannerCardComboBoxSelectionWithDeck()
void DeckEditorDeckDockWidget::setSelectedIndex(const QModelIndex &newCardIndex, bool preserveWidgetFocus) void DeckEditorDeckDockWidget::setSelectedIndex(const QModelIndex &newCardIndex, bool preserveWidgetFocus)
{ {
const QModelIndex proxyIndex = proxy->mapFromSource(newCardIndex);
deckView->clearSelection(); deckView->clearSelection();
deckView->setCurrentIndex(newCardIndex); deckView->setCurrentIndex(proxyIndex);
deckView->scrollTo(proxyIndex);
recursiveExpand(newCardIndex); recursiveExpand(newCardIndex);
if (!preserveWidgetFocus) { if (!preserveWidgetFocus) {