[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 = visualDeckStorageDefaultTagsList =
settings->value("interface/visualdeckstoragedefaulttagslist", defaultTags).toStringList(); settings->value("interface/visualdeckstoragedefaulttagslist", defaultTags).toStringList();
visualDeckStorageSearchFolderNames = settings->value("interface/visualdeckstoragesearchfoldernames", true).toBool(); visualDeckStorageSearchFolderNames = settings->value("interface/visualdeckstoragesearchfoldernames", true).toBool();
visualDeckStorageShowColorIdentity = settings->value("interface/visualdeckstorageshowcoloridentity", true).toBool();
visualDeckStorageShowBannerCardComboBox = visualDeckStorageShowBannerCardComboBox =
settings->value("interface/visualdeckstorageshowbannercardcombobox", true).toBool(); settings->value("interface/visualdeckstorageshowbannercardcombobox", true).toBool();
visualDeckStorageShowTagsOnDeckPreviews = visualDeckStorageShowTagsOnDeckPreviews =
@ -829,6 +830,13 @@ void SettingsCache::setVisualDeckStorageSearchFolderNames(QT_STATE_CHANGED_T val
settings->setValue("interface/visualdeckstoragesearchfoldernames", visualDeckStorageSearchFolderNames); 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) void SettingsCache::setVisualDeckStorageShowBannerCardComboBox(QT_STATE_CHANGED_T _showBannerCardComboBox)
{ {
visualDeckStorageShowBannerCardComboBox = _showBannerCardComboBox; visualDeckStorageShowBannerCardComboBox = _showBannerCardComboBox;

View file

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

View file

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

View file

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

View file

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

View file

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