mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Re-sort decks in VDS after toggling show folders (#5587)
This commit is contained in:
parent
07ca243d48
commit
79bf3adb2a
2 changed files with 10 additions and 3 deletions
|
|
@ -42,6 +42,7 @@ VisualDeckStorageWidget::VisualDeckStorageWidget(QWidget *parent) : QWidget(pare
|
|||
|
||||
showFoldersCheckBox = new QCheckBox(this);
|
||||
showFoldersCheckBox->setChecked(SettingsCache::instance().getVisualDeckStorageShowFolders());
|
||||
connect(showFoldersCheckBox, &QCheckBox::QT_STATE_CHANGED, this, &VisualDeckStorageWidget::updateShowFolders);
|
||||
connect(showFoldersCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||
&SettingsCache::setVisualDeckStorageShowFolders);
|
||||
|
||||
|
|
@ -125,15 +126,20 @@ void VisualDeckStorageWidget::createRootFolderWidget()
|
|||
folderWidget = new VisualDeckStorageFolderDisplayWidget(this, this, SettingsCache::instance().getDeckPath(), false,
|
||||
showFoldersCheckBox->isChecked());
|
||||
|
||||
connect(showFoldersCheckBox, &QCheckBox::QT_STATE_CHANGED, folderWidget,
|
||||
&VisualDeckStorageFolderDisplayWidget::updateShowFolders);
|
||||
|
||||
scrollArea->setWidget(folderWidget);
|
||||
scrollArea->widget()->setMaximumWidth(scrollArea->viewport()->width());
|
||||
scrollArea->widget()->adjustSize();
|
||||
updateSortOrder();
|
||||
}
|
||||
|
||||
void VisualDeckStorageWidget::updateShowFolders(bool enabled)
|
||||
{
|
||||
if (folderWidget) {
|
||||
folderWidget->updateShowFolders(enabled);
|
||||
updateSortOrder();
|
||||
}
|
||||
}
|
||||
|
||||
void VisualDeckStorageWidget::updateSortOrder()
|
||||
{
|
||||
if (folderWidget) {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ public slots:
|
|||
void deckPreviewClickedEvent(QMouseEvent *event, DeckPreviewWidget *instance);
|
||||
void deckPreviewDoubleClickedEvent(QMouseEvent *event, DeckPreviewWidget *instance);
|
||||
void createRootFolderWidget(); // Refresh the display of cards based on the current sorting option
|
||||
void updateShowFolders(bool enabled);
|
||||
void updateTagFilter();
|
||||
void updateColorFilter();
|
||||
void updateSearchFilter();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue