From b3776a6b73583061e07c983e07e7f7a4241723fd Mon Sep 17 00:00:00 2001 From: karliss Date: Sat, 11 Jan 2020 00:02:28 +0200 Subject: [PATCH] Set zoom factor when opening appearance settings. (#2003) --- src/dialogs/preferences/AppearanceOptionsWidget.cpp | 10 ++++++++-- src/dialogs/preferences/AppearanceOptionsWidget.h | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/dialogs/preferences/AppearanceOptionsWidget.cpp b/src/dialogs/preferences/AppearanceOptionsWidget.cpp index 31762640..6bcaaf28 100644 --- a/src/dialogs/preferences/AppearanceOptionsWidget.cpp +++ b/src/dialogs/preferences/AppearanceOptionsWidget.cpp @@ -28,8 +28,7 @@ AppearanceOptionsWidget::AppearanceOptionsWidget(PreferencesDialog *dialog) ui(new Ui::AppearanceOptionsWidget) { ui->setupUi(this); - updateFontFromConfig(); - updateThemeFromConfig(false); + updateFromConfig(); QStringList langs = Config()->getAvailableTranslations(); ui->languageComboBox->addItems(langs); @@ -264,6 +263,13 @@ void AppearanceOptionsWidget::updateModificationButtons(const QString& theme) ui->renameButton->setEnabled(editable); } +void AppearanceOptionsWidget::updateFromConfig() +{ + updateFontFromConfig(); + updateThemeFromConfig(false); + ui->fontZoomBox->setValue(qRound(Config()->getZoomFactor() * 100)); +} + QIcon AppearanceOptionsWidget::getIconFromSvg(const QString& fileName, const QColor& after, const QColor& before) { QFile file(fileName); diff --git a/src/dialogs/preferences/AppearanceOptionsWidget.h b/src/dialogs/preferences/AppearanceOptionsWidget.h index f0a6bae9..71885a22 100644 --- a/src/dialogs/preferences/AppearanceOptionsWidget.h +++ b/src/dialogs/preferences/AppearanceOptionsWidget.h @@ -54,8 +54,9 @@ private slots: void on_editButton_clicked(); void onLanguageComboBoxCurrentIndexChanged(int index); +private: void updateModificationButtons(const QString& theme); - + void updateFromConfig(); /** * @brief Changes all @a before colors in given @a fileName svg file to @a after