From b5b9527c13a9ef53bafc0ed1d68b103c944e5789 Mon Sep 17 00:00:00 2001 From: Zach H Date: Sun, 19 Mar 2017 20:20:06 -0400 Subject: [PATCH] Font size defaults (#2521) --- cockatrice/src/dlg_settings.cpp | 6 +++--- cockatrice/src/settingscache.cpp | 2 ++ cockatrice/src/settingscache.h | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cockatrice/src/dlg_settings.cpp b/cockatrice/src/dlg_settings.cpp index b992ec4c..64e68264 100644 --- a/cockatrice/src/dlg_settings.cpp +++ b/cockatrice/src/dlg_settings.cpp @@ -352,11 +352,11 @@ AppearanceSettingsPage::AppearanceSettingsPage() connect(&minPlayersForMultiColumnLayoutEdit, SIGNAL(valueChanged(int)), settingsCache, SLOT(setMinPlayersForMultiColumnLayout(int))); minPlayersForMultiColumnLayoutLabel.setBuddy(&minPlayersForMultiColumnLayoutEdit); + connect(&maxFontSizeForCardsEdit, SIGNAL(valueChanged(int)), settingsCache, SLOT(setMaxFontSize(int))); + maxFontSizeForCardsEdit.setValue(settingsCache->getMaxFontSize()); + maxFontSizeForCardsLabel.setBuddy(&maxFontSizeForCardsEdit); maxFontSizeForCardsEdit.setMinimum(9); maxFontSizeForCardsEdit.setMaximum(100); - maxFontSizeForCardsEdit.setValue(settingsCache->getMaxFontSize()); - connect(&maxFontSizeForCardsEdit, SIGNAL(valueChanged(int)), settingsCache, SLOT(setMaxFontSize(int))); - maxFontSizeForCardsLabel.setBuddy(&maxFontSizeForCardsEdit); QGridLayout *tableGrid = new QGridLayout; tableGrid->addWidget(&invertVerticalCoordinateCheckBox, 0, 0, 1, 2); diff --git a/cockatrice/src/settingscache.cpp b/cockatrice/src/settingscache.cpp index d54e58ea..bf7f9dea 100644 --- a/cockatrice/src/settingscache.cpp +++ b/cockatrice/src/settingscache.cpp @@ -233,6 +233,8 @@ SettingsCache::SettingsCache() soundEnabled = settings->value("sound/enabled", false).toBool(); soundThemeName = settings->value("sound/theme").toString(); + maxFontSize = settings->value("game/maxfontsize", DEFAULT_FONT_SIZE).toInt(); + priceTagFeature = settings->value("deckeditor/pricetags", false).toBool(); priceTagSource = settings->value("deckeditor/pricetagsource", 0).toInt(); diff --git a/cockatrice/src/settingscache.h b/cockatrice/src/settingscache.h index 6a825e88..d5fe4e9a 100644 --- a/cockatrice/src/settingscache.h +++ b/cockatrice/src/settingscache.h @@ -24,6 +24,8 @@ class ReleaseChannel; #define DEFAULT_LANG_CODE "en" #define DEFAULT_LANG_NAME "English" +#define DEFAULT_FONT_SIZE 12 + class QSettings; class SettingsCache : public QObject { @@ -188,7 +190,7 @@ public: bool getSpectatorsCanSeeEverything() const { return spectatorsCanSeeEverything; } bool getRememberGameSettings() const { return rememberGameSettings; } int getKeepAlive() const { return keepalive; } - int getMaxFontSize() const { return (maxFontSize > 1) ? maxFontSize : 9; } + int getMaxFontSize() const { return maxFontSize; } void setClientID(QString clientID); void setKnownMissingFeatures(QString _knownMissingFeatures); QString getClientID() { return clientID; }