From a5d3c52b8fcde2efcf85cff95c6f38ff19e28c23 Mon Sep 17 00:00:00 2001 From: RickyRister Date: Mon, 9 Dec 2024 23:14:51 -0800 Subject: [PATCH] add new setting to dlg --- cockatrice/src/dialogs/dlg_settings.cpp | 8 ++++++++ cockatrice/src/dialogs/dlg_settings.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/cockatrice/src/dialogs/dlg_settings.cpp b/cockatrice/src/dialogs/dlg_settings.cpp index 0b241c2ab..c5d93d934 100644 --- a/cockatrice/src/dialogs/dlg_settings.cpp +++ b/cockatrice/src/dialogs/dlg_settings.cpp @@ -495,11 +495,18 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage() connect(&useTearOffMenusCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(), [](const QT_STATE_CHANGED_T state) { SettingsCache::instance().setUseTearOffMenus(state == Qt::Checked); }); + cardViewInitialHeightBox.setRange(0, 9999); + cardViewInitialHeightBox.setValue(SettingsCache::instance().getCardViewInitialHeight()); + connect(&cardViewInitialHeightBox, qOverload(&QSpinBox::valueChanged), &SettingsCache::instance(), + &SettingsCache::setCardViewInitialHeight); + auto *generalGrid = new QGridLayout; generalGrid->addWidget(&doubleClickToPlayCheckBox, 0, 0); generalGrid->addWidget(&playToStackCheckBox, 1, 0); generalGrid->addWidget(&annotateTokensCheckBox, 2, 0); generalGrid->addWidget(&useTearOffMenusCheckBox, 3, 0); + generalGrid->addWidget(&cardViewInitialHeightLabel, 4, 0); + generalGrid->addWidget(&cardViewInitialHeightBox, 4, 1); generalGroupBox = new QGroupBox; generalGroupBox->setLayout(generalGrid); @@ -576,6 +583,7 @@ void UserInterfaceSettingsPage::retranslateUi() playToStackCheckBox.setText(tr("&Play all nonlands onto the stack (not the battlefield) by default")); annotateTokensCheckBox.setText(tr("Annotate card text on tokens")); useTearOffMenusCheckBox.setText(tr("Use tear-off menus, allowing right click menus to persist on screen")); + cardViewInitialHeightLabel.setText(tr("Card view window maximum initial height:")); notificationsGroupBox->setTitle(tr("Notifications settings")); notificationsEnabledCheckBox.setText(tr("Enable notifications in taskbar")); specNotificationsEnabledCheckBox.setText(tr("Notify in the taskbar for game events while you are spectating")); diff --git a/cockatrice/src/dialogs/dlg_settings.h b/cockatrice/src/dialogs/dlg_settings.h index 078c0f9b3..53b060f1a 100644 --- a/cockatrice/src/dialogs/dlg_settings.h +++ b/cockatrice/src/dialogs/dlg_settings.h @@ -126,6 +126,8 @@ private: QCheckBox playToStackCheckBox; QCheckBox annotateTokensCheckBox; QCheckBox useTearOffMenusCheckBox; + QLabel cardViewInitialHeightLabel; + QSpinBox cardViewInitialHeightBox; QCheckBox tapAnimationCheckBox; QCheckBox openDeckInNewTabCheckBox; QLabel rewindBufferingMsLabel;