mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 11:38:49 -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()
|
void DeckPreviewWidget::updateVisibility()
|
||||||
{
|
{
|
||||||
if (isVisible() != checkVisibility()) {
|
setHidden(!checkVisibility());
|
||||||
setHidden(!checkVisibility());
|
|
||||||
emit visibilityUpdated();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DeckPreviewWidget::checkVisibility() const
|
bool DeckPreviewWidget::checkVisibility() const
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ public:
|
||||||
signals:
|
signals:
|
||||||
void deckLoadRequested(const QString &filePath);
|
void deckLoadRequested(const QString &filePath);
|
||||||
void openDeckEditor(const DeckLoader *deck);
|
void openDeckEditor(const DeckLoader *deck);
|
||||||
void visibilityUpdated();
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setFilePath(const QString &filePath);
|
void setFilePath(const QString &filePath);
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,17 @@ void VisualDeckStorageWidget::retranslateUi()
|
||||||
searchFolderNamesCheckBox->setText(tr("Include Folder Names in Search"));
|
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()
|
void VisualDeckStorageWidget::createRootFolderWidget()
|
||||||
{
|
{
|
||||||
folderWidget = new VisualDeckStorageFolderDisplayWidget(this, this, SettingsCache::instance().getDeckPath(), false,
|
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->setWidget(folderWidget); // this automatically destroys the old folderWidget
|
||||||
scrollArea->widget()->setMaximumWidth(scrollArea->viewport()->width());
|
scrollArea->widget()->setMaximumWidth(scrollArea->viewport()->width());
|
||||||
scrollArea->widget()->adjustSize();
|
scrollArea->widget()->adjustSize();
|
||||||
updateSortOrder();
|
reapplySortAndFilters();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualDeckStorageWidget::updateShowFolders(bool enabled)
|
void VisualDeckStorageWidget::updateShowFolders(bool enabled)
|
||||||
{
|
{
|
||||||
if (folderWidget) {
|
if (folderWidget) {
|
||||||
folderWidget->updateShowFolders(enabled);
|
folderWidget->updateShowFolders(enabled);
|
||||||
updateSortOrder();
|
reapplySortAndFilters();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,8 @@ private:
|
||||||
QCheckBox *searchFolderNamesCheckBox;
|
QCheckBox *searchFolderNamesCheckBox;
|
||||||
QScrollArea *scrollArea;
|
QScrollArea *scrollArea;
|
||||||
VisualDeckStorageFolderDisplayWidget *folderWidget;
|
VisualDeckStorageFolderDisplayWidget *folderWidget;
|
||||||
|
|
||||||
|
void reapplySortAndFilters();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // VISUAL_DECK_STORAGE_WIDGET_H
|
#endif // VISUAL_DECK_STORAGE_WIDGET_H
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue