mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-28 08:52:19 -07:00
[Settings] Add blanket animations-enabled setting
This commit is contained in:
parent
a5f43c08fa
commit
12fb19ef06
5 changed files with 23 additions and 1 deletions
|
|
@ -116,8 +116,13 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
|||
connect(&tapAnimationCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().cardsDisplay(),
|
||||
&CardsDisplaySettings::setTapAnimation);
|
||||
|
||||
animationsEnabledCheckBox.setChecked(SettingsCache::instance().userInterface().getAnimationsEnabled());
|
||||
connect(&animationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||
&InterfaceSettings::setAnimationsEnabled);
|
||||
|
||||
auto *animationGrid = new QGridLayout;
|
||||
animationGrid->addWidget(&tapAnimationCheckBox, 0, 0);
|
||||
animationGrid->addWidget(&animationsEnabledCheckBox, 0, 0);
|
||||
animationGrid->addWidget(&tapAnimationCheckBox, 1, 0);
|
||||
|
||||
animationGroupBox = new QGroupBox;
|
||||
animationGroupBox->setLayout(animationGrid);
|
||||
|
|
@ -310,6 +315,7 @@ void UserInterfaceSettingsPage::retranslateUi()
|
|||
specNotificationsEnabledCheckBox.setText(tr("Notify in the taskbar for game events while you are spectating"));
|
||||
buddyConnectNotificationsEnabledCheckBox.setText(tr("Notify in the taskbar when users in your buddy list connect"));
|
||||
animationGroupBox->setTitle(tr("Animation settings"));
|
||||
animationsEnabledCheckBox.setText(tr("Enable game &animations"));
|
||||
tapAnimationCheckBox.setText(tr("&Tap/untap animation"));
|
||||
deckEditorGroupBox->setTitle(tr("Deck editor/storage settings"));
|
||||
openDeckInNewTabCheckBox.setText(tr("Open deck in new tab by default"));
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ private:
|
|||
QCheckBox useTearOffMenusCheckBox;
|
||||
QCheckBox keepGameChatFocusCheckBox;
|
||||
QCheckBox tapAnimationCheckBox;
|
||||
QCheckBox animationsEnabledCheckBox;
|
||||
QCheckBox openDeckInNewTabCheckBox;
|
||||
QLabel visualDeckStoragePromptForConversionLabel;
|
||||
QComboBox visualDeckStoragePromptForConversionSelector;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ public:
|
|||
[[nodiscard]] virtual bool getShowStatusBar() const = 0;
|
||||
[[nodiscard]] virtual bool getShowShortcuts() const = 0;
|
||||
[[nodiscard]] virtual bool getShowGameSelectorFilterToolbar() const = 0;
|
||||
[[nodiscard]] virtual bool getAnimationsEnabled() const = 0;
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_INTERFACE_INTERFACE_SETTINGS_PROVIDER_H
|
||||
|
|
|
|||
|
|
@ -160,6 +160,11 @@ bool InterfaceSettings::getShowGameSelectorFilterToolbar() const
|
|||
return getValue("showGameSelectorFilterToolbar", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool InterfaceSettings::getAnimationsEnabled() const
|
||||
{
|
||||
return getValue("animationsEnabled", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
void InterfaceSettings::setUseTearOffMenus(bool _useTearOffMenus)
|
||||
{
|
||||
setValue(_useTearOffMenus, "useTearOffMenus");
|
||||
|
|
@ -326,3 +331,9 @@ void InterfaceSettings::setShowGameSelectorFilterToolbar(bool _showGameSelectorF
|
|||
setValue(_showGameSelectorFilterToolbar, "showGameSelectorFilterToolbar");
|
||||
emit showGameSelectorFilterToolbarChanged(_showGameSelectorFilterToolbar);
|
||||
}
|
||||
|
||||
void InterfaceSettings::setAnimationsEnabled(bool _animationsEnabled)
|
||||
{
|
||||
setValue(_animationsEnabled, "animationsEnabled");
|
||||
emit animationsEnabledChanged(_animationsEnabled);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ public:
|
|||
[[nodiscard]] bool getShowStatusBar() const override;
|
||||
[[nodiscard]] bool getShowShortcuts() const override;
|
||||
[[nodiscard]] bool getShowGameSelectorFilterToolbar() const override;
|
||||
[[nodiscard]] bool getAnimationsEnabled() const override;
|
||||
|
||||
void setUseTearOffMenus(bool _useTearOffMenus);
|
||||
void setCardViewInitialRowsMax(int _cardViewInitialRowsMax);
|
||||
|
|
@ -74,6 +75,7 @@ public:
|
|||
void setShowStatusBar(bool _showStatusBar);
|
||||
void setShowShortcuts(bool _showShortcuts);
|
||||
void setShowGameSelectorFilterToolbar(bool _showGameSelectorFilterToolbar);
|
||||
void setAnimationsEnabled(bool _animationsEnabled);
|
||||
|
||||
signals:
|
||||
void useTearOffMenusChanged(bool state);
|
||||
|
|
@ -85,6 +87,7 @@ signals:
|
|||
void tallyTypeChanged(int type);
|
||||
void showStatusBarChanged(bool state);
|
||||
void showGameSelectorFilterToolbarChanged(bool state);
|
||||
void animationsEnabledChanged(bool state);
|
||||
|
||||
public:
|
||||
explicit InterfaceSettings(const QString &settingPath, QObject *parent = nullptr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue