Set zoom factor when opening appearance settings. (#2003)

This commit is contained in:
karliss 2020-01-11 00:02:28 +02:00 committed by GitHub
parent 830e9cd947
commit b3776a6b73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -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);

View File

@ -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