mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
[VDS] Add option to hide color identity (#6533)
This commit is contained in:
parent
485d5a8b48
commit
d9b9c79112
6 changed files with 46 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue