mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Fix VDS filters not applying after refresh (#5662)
* reapply sort and filters after each reset * fix unflatten folder still not applying afterwards
This commit is contained in:
parent
ecbdd32a2d
commit
08bb18cefe
4 changed files with 17 additions and 8 deletions
|
|
@ -105,10 +105,7 @@ void DeckPreviewWidget::initializeUi(const bool deckLoadSuccess)
|
|||
|
||||
void DeckPreviewWidget::updateVisibility()
|
||||
{
|
||||
if (isVisible() != checkVisibility()) {
|
||||
setHidden(!checkVisibility());
|
||||
emit visibilityUpdated();
|
||||
}
|
||||
setHidden(!checkVisibility());
|
||||
}
|
||||
|
||||
bool DeckPreviewWidget::checkVisibility() const
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ public:
|
|||
signals:
|
||||
void deckLoadRequested(const QString &filePath);
|
||||
void openDeckEditor(const DeckLoader *deck);
|
||||
void visibilityUpdated();
|
||||
|
||||
public slots:
|
||||
void setFilePath(const QString &filePath);
|
||||
|
|
|
|||
|
|
@ -164,6 +164,17 @@ void VisualDeckStorageWidget::retranslateUi()
|
|||
searchFolderNamesCheckBox->setText(tr("Include Folder Names in Search"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Reapplies all sort and filter options by calling the appropriate update methods.
|
||||
*/
|
||||
void VisualDeckStorageWidget::reapplySortAndFilters()
|
||||
{
|
||||
updateSortOrder();
|
||||
updateTagFilter();
|
||||
updateColorFilter();
|
||||
updateSearchFilter();
|
||||
}
|
||||
|
||||
void VisualDeckStorageWidget::createRootFolderWidget()
|
||||
{
|
||||
folderWidget = new VisualDeckStorageFolderDisplayWidget(this, this, SettingsCache::instance().getDeckPath(), false,
|
||||
|
|
@ -172,14 +183,14 @@ void VisualDeckStorageWidget::createRootFolderWidget()
|
|||
scrollArea->setWidget(folderWidget); // this automatically destroys the old folderWidget
|
||||
scrollArea->widget()->setMaximumWidth(scrollArea->viewport()->width());
|
||||
scrollArea->widget()->adjustSize();
|
||||
updateSortOrder();
|
||||
reapplySortAndFilters();
|
||||
}
|
||||
|
||||
void VisualDeckStorageWidget::updateShowFolders(bool enabled)
|
||||
{
|
||||
if (folderWidget) {
|
||||
folderWidget->updateShowFolders(enabled);
|
||||
updateSortOrder();
|
||||
reapplySortAndFilters();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -227,4 +238,4 @@ void VisualDeckStorageWidget::updateTagsVisibility(const bool visible)
|
|||
} else {
|
||||
tagFilterWidget->setHidden(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -66,6 +66,8 @@ private:
|
|||
QCheckBox *searchFolderNamesCheckBox;
|
||||
QScrollArea *scrollArea;
|
||||
VisualDeckStorageFolderDisplayWidget *folderWidget;
|
||||
|
||||
void reapplySortAndFilters();
|
||||
};
|
||||
|
||||
#endif // VISUAL_DECK_STORAGE_WIDGET_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue