Move show folders option next to the search bar.

This commit is contained in:
Lukas Brübach 2025-02-10 10:23:19 +01:00
parent d1102939a2
commit 04dc843c4e
2 changed files with 5 additions and 12 deletions

View file

@ -172,7 +172,7 @@ void VisualDeckStorageFolderDisplayWidget::updateShowFolders(bool enabled)
if (!showFolders) { if (!showFolders) {
flattenFolderStructure(); flattenFolderStructure();
} else { } else {
// if setting was switched from disabled to enabled, we assume that there isn't any existing subfolders // if setting was switched from disabled to enabled, we assume that there aren't any existing subfolders
createWidgetsForFiles(); createWidgetsForFiles();
createWidgetsForFolders(); createWidgetsForFolders();
} }

View file

@ -32,22 +32,16 @@ VisualDeckStorageWidget::VisualDeckStorageWidget(QWidget *parent) : QWidget(pare
sortWidget = new VisualDeckStorageSortWidget(this); sortWidget = new VisualDeckStorageSortWidget(this);
searchWidget = new VisualDeckStorageSearchWidget(this); searchWidget = new VisualDeckStorageSearchWidget(this);
searchAndSortLayout->addWidget(deckPreviewColorIdentityFilterWidget);
searchAndSortLayout->addWidget(sortWidget);
searchAndSortLayout->addWidget(searchWidget);
// checkbox row
QHBoxLayout *checkBoxLayout = new QHBoxLayout(this);
checkBoxLayout->setContentsMargins(9, 0, 9, 0);
showFoldersCheckBox = new QCheckBox(this); showFoldersCheckBox = new QCheckBox(this);
showFoldersCheckBox->setChecked(SettingsCache::instance().getVisualDeckStorageShowFolders()); showFoldersCheckBox->setChecked(SettingsCache::instance().getVisualDeckStorageShowFolders());
connect(showFoldersCheckBox, &QCheckBox::QT_STATE_CHANGED, this, &VisualDeckStorageWidget::updateShowFolders); connect(showFoldersCheckBox, &QCheckBox::QT_STATE_CHANGED, this, &VisualDeckStorageWidget::updateShowFolders);
connect(showFoldersCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(), connect(showFoldersCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
&SettingsCache::setVisualDeckStorageShowFolders); &SettingsCache::setVisualDeckStorageShowFolders);
checkBoxLayout->addWidget(showFoldersCheckBox); searchAndSortLayout->addWidget(deckPreviewColorIdentityFilterWidget);
checkBoxLayout->addStretch(); searchAndSortLayout->addWidget(sortWidget);
searchAndSortLayout->addWidget(searchWidget);
searchAndSortLayout->addWidget(showFoldersCheckBox);
// tag filter box // tag filter box
tagFilterWidget = new VisualDeckStorageTagFilterWidget(this); tagFilterWidget = new VisualDeckStorageTagFilterWidget(this);
@ -63,7 +57,6 @@ VisualDeckStorageWidget::VisualDeckStorageWidget(QWidget *parent) : QWidget(pare
// putting everything together // putting everything together
layout->addLayout(searchAndSortLayout); layout->addLayout(searchAndSortLayout);
layout->addLayout(checkBoxLayout);
layout->addWidget(tagFilterWidget); layout->addWidget(tagFilterWidget);
layout->addWidget(scrollArea); layout->addWidget(scrollArea);
layout->addWidget(cardSizeWidget); layout->addWidget(cardSizeWidget);