[VDS] Add option to hide color identity (#6533)

This commit is contained in:
RickyRister 2026-01-19 00:38:48 -08:00 committed by GitHub
parent 485d5a8b48
commit d9b9c79112
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 46 additions and 1 deletions

View file

@ -310,6 +310,7 @@ SettingsCache::SettingsCache()
visualDeckStorageDefaultTagsList =
settings->value("interface/visualdeckstoragedefaulttagslist", defaultTags).toStringList();
visualDeckStorageSearchFolderNames = settings->value("interface/visualdeckstoragesearchfoldernames", true).toBool();
visualDeckStorageShowColorIdentity = settings->value("interface/visualdeckstorageshowcoloridentity", true).toBool();
visualDeckStorageShowBannerCardComboBox =
settings->value("interface/visualdeckstorageshowbannercardcombobox", true).toBool();
visualDeckStorageShowTagsOnDeckPreviews =
@ -829,6 +830,13 @@ void SettingsCache::setVisualDeckStorageSearchFolderNames(QT_STATE_CHANGED_T val
settings->setValue("interface/visualdeckstoragesearchfoldernames", visualDeckStorageSearchFolderNames);
}
void SettingsCache::setVisualDeckStorageShowColorIdentity(QT_STATE_CHANGED_T value)
{
visualDeckStorageShowColorIdentity = value;
settings->setValue("interface/visualdeckstorageshowcoloridentity", visualDeckStorageShowColorIdentity);
emit visualDeckStorageShowColorIdentityChanged(visualDeckStorageShowColorIdentity);
}
void SettingsCache::setVisualDeckStorageShowBannerCardComboBox(QT_STATE_CHANGED_T _showBannerCardComboBox)
{
visualDeckStorageShowBannerCardComboBox = _showBannerCardComboBox;

View file

@ -158,6 +158,7 @@ signals:
void deckEditorTagsWidgetVisibleChanged(bool _visible);
void visualDeckStorageShowTagFilterChanged(bool _visible);
void visualDeckStorageDefaultTagsListChanged();
void visualDeckStorageShowColorIdentityChanged(bool _visible);
void visualDeckStorageShowBannerCardComboBoxChanged(bool _visible);
void visualDeckStorageShowTagsOnDeckPreviewsChanged(bool _visible);
void visualDeckStorageCardSizeChanged();
@ -251,6 +252,7 @@ private:
bool deckEditorTagsWidgetVisible;
int visualDeckStorageSortingOrder;
bool visualDeckStorageShowFolders;
bool visualDeckStorageShowColorIdentity;
bool visualDeckStorageShowBannerCardComboBox;
bool visualDeckStorageShowTagsOnDeckPreviews;
bool visualDeckStorageShowTagFilter;
@ -621,6 +623,10 @@ public:
{
return visualDeckStorageSearchFolderNames;
}
[[nodiscard]] bool getVisualDeckStorageShowColorIdentity() const
{
return visualDeckStorageShowColorIdentity;
}
[[nodiscard]] bool getVisualDeckStorageShowBannerCardComboBox() const
{
return visualDeckStorageShowBannerCardComboBox;
@ -1045,6 +1051,7 @@ public slots:
void setVisualDeckStorageShowTagFilter(QT_STATE_CHANGED_T _showTags);
void setVisualDeckStorageDefaultTagsList(QStringList _defaultTagsList);
void setVisualDeckStorageSearchFolderNames(QT_STATE_CHANGED_T value);
void setVisualDeckStorageShowColorIdentity(QT_STATE_CHANGED_T value);
void setVisualDeckStorageShowBannerCardComboBox(QT_STATE_CHANGED_T _showBannerCardComboBox);
void setVisualDeckStorageShowTagsOnDeckPreviews(QT_STATE_CHANGED_T _showTags);
void setVisualDeckStorageCardSize(int _visualDeckStorageCardSize);
@ -1117,5 +1124,4 @@ public slots:
void setMaxFontSize(int _max);
void setRoundCardCorners(bool _roundCardCorners);
};
#endif

View file

@ -42,6 +42,8 @@ DeckPreviewWidget::DeckPreviewWidget(QWidget *_parent,
connect(bannerCardDisplayWidget, &DeckPreviewCardPictureWidget::imageDoubleClicked, this,
&DeckPreviewWidget::imageDoubleClickedEvent);
connect(&SettingsCache::instance(), &SettingsCache::visualDeckStorageShowColorIdentityChanged, this,
&DeckPreviewWidget::updateColorIdentityVisibility);
connect(&SettingsCache::instance(), &SettingsCache::visualDeckStorageShowTagsOnDeckPreviewsChanged, this,
&DeckPreviewWidget::updateTagsVisibility);
connect(&SettingsCache::instance(), &SettingsCache::visualDeckStorageShowBannerCardComboBoxChanged, this,
@ -96,6 +98,7 @@ void DeckPreviewWidget::initializeUi(const bool deckLoadSuccess)
connect(bannerCardComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&DeckPreviewWidget::setBannerCard);
updateColorIdentityVisibility(SettingsCache::instance().getVisualDeckStorageShowColorIdentity());
updateBannerCardComboBox();
updateBannerCardComboBoxVisibility(SettingsCache::instance().getVisualDeckStorageShowBannerCardComboBox());
updateTagsVisibility(SettingsCache::instance().getVisualDeckStorageShowTagsOnDeckPreviews());
@ -123,6 +126,15 @@ bool DeckPreviewWidget::checkVisibility() const
return true;
}
void DeckPreviewWidget::updateColorIdentityVisibility(bool visible)
{
if (colorIdentityWidget == nullptr) {
return;
}
colorIdentityWidget->setVisible(visible);
}
void DeckPreviewWidget::updateBannerCardComboBoxVisibility(bool visible)
{
if (bannerCardComboBox == nullptr) {

View file

@ -63,6 +63,7 @@ public slots:
void imageDoubleClickedEvent(QMouseEvent *event, DeckPreviewCardPictureWidget *instance);
void initializeUi(bool deckLoadSuccess);
void updateVisibility();
void updateColorIdentityVisibility(bool visible);
void updateBannerCardComboBoxVisibility(bool visible);
void updateTagsVisibility(bool visible);
void resizeEvent(QResizeEvent *event) override;

View file

@ -26,6 +26,14 @@ VisualDeckStorageQuickSettingsWidget::VisualDeckStorageQuickSettingsWidget(QWidg
connect(showTagFilterCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
&SettingsCache::setVisualDeckStorageShowTagFilter);
// show color identity on DeckPreviewWidget checkbox
showColorIdentityCheckBox = new QCheckBox(this);
showColorIdentityCheckBox->setChecked(SettingsCache::instance().getVisualDeckStorageShowColorIdentity());
connect(showColorIdentityCheckBox, &QCheckBox::QT_STATE_CHANGED, this,
&VisualDeckStorageQuickSettingsWidget::showColorIdentityChanged);
connect(showColorIdentityCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
&SettingsCache::setVisualDeckStorageShowColorIdentity);
// show tags on DeckPreviewWidget checkbox
showTagsOnDeckPreviewsCheckBox = new QCheckBox(this);
showTagsOnDeckPreviewsCheckBox->setChecked(SettingsCache::instance().getVisualDeckStorageShowTagsOnDeckPreviews());
@ -103,6 +111,7 @@ VisualDeckStorageQuickSettingsWidget::VisualDeckStorageQuickSettingsWidget(QWidg
// putting everything together
this->addSettingsWidget(showFoldersCheckBox);
this->addSettingsWidget(showTagFilterCheckBox);
this->addSettingsWidget(showColorIdentityCheckBox);
this->addSettingsWidget(showTagsOnDeckPreviewsCheckBox);
this->addSettingsWidget(showBannerCardComboBoxCheckBox);
this->addSettingsWidget(drawUnusedColorIdentitiesCheckBox);
@ -119,6 +128,7 @@ void VisualDeckStorageQuickSettingsWidget::retranslateUi()
{
showFoldersCheckBox->setText(tr("Show Folders"));
showTagFilterCheckBox->setText(tr("Show Tag Filter"));
showColorIdentityCheckBox->setText(tr("Show Color Identity"));
showTagsOnDeckPreviewsCheckBox->setText(tr("Show Tags On Deck Previews"));
showBannerCardComboBoxCheckBox->setText(tr("Show Banner Card Selection Option"));
drawUnusedColorIdentitiesCheckBox->setText(tr("Draw unused Color Identities"));
@ -140,6 +150,11 @@ bool VisualDeckStorageQuickSettingsWidget::getDrawUnusedColorIdentities() const
return drawUnusedColorIdentitiesCheckBox->isChecked();
}
bool VisualDeckStorageQuickSettingsWidget::getShowColorIdentity() const
{
return showColorIdentityCheckBox->isChecked();
}
bool VisualDeckStorageQuickSettingsWidget::getShowBannerCardComboBox() const
{
return showBannerCardComboBoxCheckBox->isChecked();

View file

@ -22,6 +22,7 @@ class VisualDeckStorageQuickSettingsWidget : public SettingsButtonWidget
Q_OBJECT
QCheckBox *showFoldersCheckBox;
QCheckBox *showColorIdentityCheckBox;
QCheckBox *drawUnusedColorIdentitiesCheckBox;
QCheckBox *showBannerCardComboBoxCheckBox;
QCheckBox *showTagFilterCheckBox;
@ -49,6 +50,7 @@ public:
[[nodiscard]] bool getShowFolders() const;
[[nodiscard]] bool getDrawUnusedColorIdentities() const;
[[nodiscard]] bool getShowColorIdentity() const;
[[nodiscard]] bool getShowBannerCardComboBox() const;
[[nodiscard]] bool getShowTagFilter() const;
[[nodiscard]] bool getShowTagsOnDeckPreviews() const;
@ -59,6 +61,7 @@ public:
signals:
void showFoldersChanged(bool enabled);
void drawUnusedColorIdentitiesChanged(bool enabled);
void showColorIdentityChanged(bool enabled);
void showBannerCardComboBoxChanged(bool enabled);
void showTagFilterChanged(bool enabled);
void showTagsOnDeckPreviewsChanged(bool enabled);