mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-10 20:25:29 -08:00
Compare commits
1 Commits
dependabot
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0deaa9d9b4 |
@@ -459,12 +459,15 @@ void DeckEditorDeckDockWidget::syncBannerCardComboBoxSelectionWithDeck()
|
||||
}
|
||||
}
|
||||
|
||||
void DeckEditorDeckDockWidget::setSelectedIndex(const QModelIndex &newCardIndex)
|
||||
void DeckEditorDeckDockWidget::setSelectedIndex(const QModelIndex &newCardIndex, bool preserveWidgetFocus)
|
||||
{
|
||||
deckView->clearSelection();
|
||||
deckView->setCurrentIndex(newCardIndex);
|
||||
recursiveExpand(newCardIndex);
|
||||
deckView->setFocus(Qt::FocusReason::MouseFocusReason);
|
||||
|
||||
if (!preserveWidgetFocus) {
|
||||
deckView->setFocus(Qt::FocusReason::MouseFocusReason);
|
||||
}
|
||||
}
|
||||
|
||||
void DeckEditorDeckDockWidget::syncDisplayWidgetsToModel()
|
||||
|
||||
@@ -100,7 +100,7 @@ private slots:
|
||||
void writeComments();
|
||||
void writeBannerCard(int);
|
||||
void applyActiveGroupCriteria();
|
||||
void setSelectedIndex(const QModelIndex &newCardIndex);
|
||||
void setSelectedIndex(const QModelIndex &newCardIndex, bool preserveWidgetFocus);
|
||||
void updateHash();
|
||||
void refreshShortcuts();
|
||||
void updateShowBannerCardComboBox(bool visible);
|
||||
|
||||
@@ -182,7 +182,7 @@ QModelIndex DeckStateManager::addCard(const ExactCard &card, const QString &zone
|
||||
QModelIndex idx = modifyDeck(reason, [&card, &zone](auto model) { return model->addCard(card, zone); });
|
||||
|
||||
if (idx.isValid()) {
|
||||
emit focusIndexChanged(idx);
|
||||
emit focusIndexChanged(idx, true);
|
||||
}
|
||||
|
||||
return idx;
|
||||
@@ -208,7 +208,7 @@ QModelIndex DeckStateManager::decrementCard(const ExactCard &card, const QString
|
||||
}
|
||||
|
||||
if (idx.isValid()) {
|
||||
emit focusIndexChanged(idx);
|
||||
emit focusIndexChanged(idx, true);
|
||||
}
|
||||
|
||||
return idx;
|
||||
|
||||
@@ -290,8 +290,9 @@ signals:
|
||||
/**
|
||||
* The selected card on any views connected to this deck should be changed to this index.
|
||||
* @param index The model index
|
||||
* @param preserveWidgetFocus Whether to keep the widget focus unchanged
|
||||
*/
|
||||
void focusIndexChanged(QModelIndex index);
|
||||
void focusIndexChanged(QModelIndex index, bool preserveWidgetFocus);
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_DECK_STATE_MANAGER_H
|
||||
@@ -198,7 +198,7 @@ void CardAmountWidget::addPrinting(const QString &zone)
|
||||
});
|
||||
|
||||
if (newCardIndex.isValid()) {
|
||||
emit deckStateManager->focusIndexChanged(newCardIndex);
|
||||
emit deckStateManager->focusIndexChanged(newCardIndex, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user