mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-28 00:42:19 -07:00
[Settings] Keep menu settings on the appearance settings page
Leave the 'Menu settings' group box on the appearance settings page for now; relocating it to the user interface settings page will be done in a separate PR. Took 6 minutes
This commit is contained in:
parent
84c8743fe3
commit
e7c62a15f7
4 changed files with 30 additions and 22 deletions
|
|
@ -150,6 +150,21 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
|||
stylingGroupBox = new QGroupBox;
|
||||
stylingGroupBox->setLayout(stylingTabGrid);
|
||||
|
||||
// Menu settings
|
||||
showShortcutsCheckBox.setChecked(settings.userInterface().getShowShortcuts());
|
||||
connect(&showShortcutsCheckBox, &QCheckBox::QT_STATE_CHANGED, this, &AppearanceSettingsPage::showShortcutsChanged);
|
||||
|
||||
showGameSelectorFilterToolbarCheckBox.setChecked(settings.userInterface().getShowGameSelectorFilterToolbar());
|
||||
connect(&showGameSelectorFilterToolbarCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.userInterface(),
|
||||
&InterfaceSettings::setShowGameSelectorFilterToolbar);
|
||||
|
||||
auto *menuGrid = new QGridLayout;
|
||||
menuGrid->addWidget(&showShortcutsCheckBox, 0, 0);
|
||||
menuGrid->addWidget(&showGameSelectorFilterToolbarCheckBox, 1, 0);
|
||||
|
||||
menuGroupBox = new QGroupBox;
|
||||
menuGroupBox->setLayout(menuGrid);
|
||||
|
||||
// Printings settings
|
||||
overrideAllCardArtWithPersonalPreferenceCheckBox.setChecked(
|
||||
settings.cardsDisplay().getOverrideAllCardArtWithPersonalPreference());
|
||||
|
|
@ -315,6 +330,7 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
|||
mainLayout->addWidget(themeGroupBox);
|
||||
mainLayout->addWidget(homeTabGroupBox);
|
||||
mainLayout->addWidget(stylingGroupBox);
|
||||
mainLayout->addWidget(menuGroupBox);
|
||||
mainLayout->addWidget(printingsGroupBox);
|
||||
mainLayout->addWidget(cardsGroupBox);
|
||||
mainLayout->addWidget(cardLayoutGroupBox);
|
||||
|
|
@ -367,6 +383,12 @@ void AppearanceSettingsPage::updateHomeTabSettingsVisibility()
|
|||
homeTabDisplayCardNameCheckBox.setVisible(visible);
|
||||
}
|
||||
|
||||
void AppearanceSettingsPage::showShortcutsChanged(QT_STATE_CHANGED_T value)
|
||||
{
|
||||
SettingsCache::instance().userInterface().setShowShortcuts(value);
|
||||
qApp->setAttribute(Qt::AA_DontShowShortcutsInContextMenus, value == 0); // 0 = unchecked
|
||||
}
|
||||
|
||||
void AppearanceSettingsPage::overrideAllCardArtWithPersonalPreferenceToggled(QT_STATE_CHANGED_T value)
|
||||
{
|
||||
bool enable = static_cast<bool>(value);
|
||||
|
|
@ -428,6 +450,10 @@ void AppearanceSettingsPage::retranslateUi()
|
|||
stylingGroupBox->setTitle(tr("Styling settings"));
|
||||
styleUserListCheckBox.setText(tr("Style user list"));
|
||||
|
||||
menuGroupBox->setTitle(tr("Menu settings"));
|
||||
showShortcutsCheckBox.setText(tr("Show keyboard shortcuts in right-click menus"));
|
||||
showGameSelectorFilterToolbarCheckBox.setText(tr("Show game filter toolbar above list in room tab"));
|
||||
|
||||
printingsGroupBox->setTitle(tr("Card printings"));
|
||||
overrideAllCardArtWithPersonalPreferenceCheckBox.setText(
|
||||
tr("Override all card art with personal set preference (Pre-ProviderID change behavior)"));
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ private slots:
|
|||
void openThemeLocation();
|
||||
void editPalette();
|
||||
void updateHomeTabSettingsVisibility();
|
||||
void showShortcutsChanged(QT_STATE_CHANGED_T enabled);
|
||||
void overrideAllCardArtWithPersonalPreferenceToggled(QT_STATE_CHANGED_T enabled);
|
||||
|
||||
void cardViewInitialRowsMaxChanged(int value);
|
||||
|
|
@ -39,6 +40,8 @@ private:
|
|||
QSpinBox homeTabBackgroundShuffleFrequencySpinBox;
|
||||
QCheckBox homeTabDisplayCardNameCheckBox;
|
||||
QCheckBox styleUserListCheckBox;
|
||||
QCheckBox showShortcutsCheckBox;
|
||||
QCheckBox showGameSelectorFilterToolbarCheckBox;
|
||||
QLabel minPlayersForMultiColumnLayoutLabel;
|
||||
QLabel maxFontSizeForCardsLabel;
|
||||
QCheckBox overrideAllCardArtWithPersonalPreferenceCheckBox;
|
||||
|
|
@ -59,6 +62,7 @@ private:
|
|||
QGroupBox *themeGroupBox;
|
||||
QGroupBox *homeTabGroupBox;
|
||||
QGroupBox *stylingGroupBox;
|
||||
QGroupBox *menuGroupBox;
|
||||
QGroupBox *printingsGroupBox;
|
||||
QGroupBox *cardsGroupBox;
|
||||
QGroupBox *cardLayoutGroupBox;
|
||||
|
|
|
|||
|
|
@ -86,15 +86,6 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
|||
connect(&keepGameChatFocusCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||
&InterfaceSettings::setKeepGameChatFocus);
|
||||
|
||||
showShortcutsCheckBox.setChecked(SettingsCache::instance().userInterface().getShowShortcuts());
|
||||
connect(&showShortcutsCheckBox, &QCheckBox::QT_STATE_CHANGED, this,
|
||||
&UserInterfaceSettingsPage::showShortcutsChanged);
|
||||
|
||||
showGameSelectorFilterToolbarCheckBox.setChecked(
|
||||
SettingsCache::instance().userInterface().getShowGameSelectorFilterToolbar());
|
||||
connect(&showGameSelectorFilterToolbarCheckBox, &QCheckBox::QT_STATE_CHANGED,
|
||||
&SettingsCache::instance().userInterface(), &InterfaceSettings::setShowGameSelectorFilterToolbar);
|
||||
|
||||
auto *generalGrid = new QGridLayout;
|
||||
generalGrid->addWidget(&doubleClickToPlayCheckBox, 0, 0);
|
||||
generalGrid->addWidget(&clickPlaysAllSelectedCheckBox, 1, 0);
|
||||
|
|
@ -107,8 +98,6 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
|||
generalGrid->addWidget(&showTotalSelectionCountCheckBox, 8, 0);
|
||||
generalGrid->addWidget(&useTearOffMenusCheckBox, 9, 0);
|
||||
generalGrid->addWidget(&keepGameChatFocusCheckBox, 10, 0);
|
||||
generalGrid->addWidget(&showShortcutsCheckBox, 11, 0);
|
||||
generalGrid->addWidget(&showGameSelectorFilterToolbarCheckBox, 12, 0);
|
||||
|
||||
generalGroupBox = new QGroupBox;
|
||||
generalGroupBox->setLayout(generalGrid);
|
||||
|
|
@ -223,12 +212,6 @@ void UserInterfaceSettingsPage::setNotificationEnabled(QT_STATE_CHANGED_T i)
|
|||
}
|
||||
}
|
||||
|
||||
void UserInterfaceSettingsPage::showShortcutsChanged(QT_STATE_CHANGED_T value)
|
||||
{
|
||||
SettingsCache::instance().userInterface().setShowShortcuts(value);
|
||||
qApp->setAttribute(Qt::AA_DontShowShortcutsInContextMenus, value == 0); // 0 = unchecked
|
||||
}
|
||||
|
||||
void UserInterfaceSettingsPage::retranslateUi()
|
||||
{
|
||||
generalGroupBox->setTitle(tr("General interface settings"));
|
||||
|
|
@ -244,8 +227,6 @@ void UserInterfaceSettingsPage::retranslateUi()
|
|||
useTearOffMenusCheckBox.setText(tr("Use tear-off menus, allowing right click menus to persist on screen"));
|
||||
keepGameChatFocusCheckBox.setText(
|
||||
tr("Keep game chat focused when clicking in game (Note: disables card view search bar)"));
|
||||
showShortcutsCheckBox.setText(tr("Show keyboard shortcuts in right-click menus"));
|
||||
showGameSelectorFilterToolbarCheckBox.setText(tr("Show game filter toolbar above list in room tab"));
|
||||
|
||||
notificationsGroupBox->setTitle(tr("Notifications settings"));
|
||||
notificationsEnabledCheckBox.setText(tr("Enable notifications in taskbar"));
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ class UserInterfaceSettingsPage : public AbstractSettingsPage
|
|||
Q_OBJECT
|
||||
private slots:
|
||||
void setNotificationEnabled(QT_STATE_CHANGED_T);
|
||||
void showShortcutsChanged(QT_STATE_CHANGED_T);
|
||||
|
||||
private:
|
||||
QCheckBox notificationsEnabledCheckBox;
|
||||
|
|
@ -32,8 +31,6 @@ private:
|
|||
QCheckBox showTotalSelectionCountCheckBox;
|
||||
QCheckBox useTearOffMenusCheckBox;
|
||||
QCheckBox keepGameChatFocusCheckBox;
|
||||
QCheckBox showShortcutsCheckBox;
|
||||
QCheckBox showGameSelectorFilterToolbarCheckBox;
|
||||
QCheckBox tapAnimationCheckBox;
|
||||
QCheckBox openDeckInNewTabCheckBox;
|
||||
QLabel visualDeckStoragePromptForConversionLabel;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue