@@ -177,6 +177,15 @@ SettingsDialog::SettingsDialog(int page, QWidget *parent)
177177 connect (ui->aiAutocompleteCheckBox , SIGNAL (toggled (bool )), this , SLOT (needRestart ()));
178178 connect (ui->webAppServerUrlLineEdit , SIGNAL (textChanged (QString)), this , SLOT (needRestart ()));
179179 connect (ui->webAppTokenLineEdit , SIGNAL (textChanged (QString)), this , SLOT (needRestart ()));
180+
181+ connect (ui->showMarkdownImagePreviewsCheckBox , &QCheckBox::toggled,
182+ ui->markdownImagePreviewMaxWidthLabel , &QWidget::setEnabled);
183+ connect (ui->showMarkdownImagePreviewsCheckBox , &QCheckBox::toggled,
184+ ui->markdownImagePreviewMaxWidthSpinBox , &QWidget::setEnabled);
185+ connect (ui->showMarkdownImagePreviewsCheckBox , &QCheckBox::toggled,
186+ ui->markdownImagePreviewMaxHeightLabel , &QWidget::setEnabled);
187+ connect (ui->showMarkdownImagePreviewsCheckBox , &QCheckBox::toggled,
188+ ui->markdownImagePreviewMaxHeightSpinBox , &QWidget::setEnabled);
180189 // connect(ui->layoutWidget, SIGNAL(settingsStored()),
181190 // this, SLOT(needRestart()));
182191
@@ -600,6 +609,12 @@ void SettingsDialog::storeSettings() {
600609 ui->highlightCurrentLineCheckBox ->isChecked ());
601610 settings.setValue (QStringLiteral (" Editor/hangingIndent" ),
602611 ui->hangingIndentCheckBox ->isChecked ());
612+ settings.setValue (QStringLiteral (" Editor/showMarkdownImagePreviews" ),
613+ ui->showMarkdownImagePreviewsCheckBox ->isChecked ());
614+ settings.setValue (QStringLiteral (" Editor/markdownImagePreviewMaxWidth" ),
615+ ui->markdownImagePreviewMaxWidthSpinBox ->value ());
616+ settings.setValue (QStringLiteral (" Editor/markdownImagePreviewMaxHeight" ),
617+ ui->markdownImagePreviewMaxHeightSpinBox ->value ());
603618 settings.setValue (QStringLiteral (" Editor/editorWidthInDFMOnly" ),
604619 ui->editorWidthInDFMOnlyCheckBox ->isChecked ());
605620 settings.setValue (QStringLiteral (" Editor/vimMode" ), ui->vimModeCheckBox ->isChecked ());
@@ -994,6 +1009,17 @@ void SettingsDialog::readSettings() {
9941009 settings.value (QStringLiteral (" Editor/highlightCurrentLine" ), true ).toBool ());
9951010 ui->hangingIndentCheckBox ->setChecked (
9961011 settings.value (QStringLiteral (" Editor/hangingIndent" ), true ).toBool ());
1012+ ui->showMarkdownImagePreviewsCheckBox ->setChecked (
1013+ settings.value (QStringLiteral (" Editor/showMarkdownImagePreviews" ), true ).toBool ());
1014+ ui->markdownImagePreviewMaxWidthSpinBox ->setValue (
1015+ settings.value (QStringLiteral (" Editor/markdownImagePreviewMaxWidth" ), 1024 ).toInt ());
1016+ ui->markdownImagePreviewMaxHeightSpinBox ->setValue (
1017+ settings.value (QStringLiteral (" Editor/markdownImagePreviewMaxHeight" ), 1024 ).toInt ());
1018+ const bool inlineImagePreviewEnabled = ui->showMarkdownImagePreviewsCheckBox ->isChecked ();
1019+ ui->markdownImagePreviewMaxWidthLabel ->setEnabled (inlineImagePreviewEnabled);
1020+ ui->markdownImagePreviewMaxWidthSpinBox ->setEnabled (inlineImagePreviewEnabled);
1021+ ui->markdownImagePreviewMaxHeightLabel ->setEnabled (inlineImagePreviewEnabled);
1022+ ui->markdownImagePreviewMaxHeightSpinBox ->setEnabled (inlineImagePreviewEnabled);
9971023 ui->editorWidthInDFMOnlyCheckBox ->setChecked (
9981024 settings.value (QStringLiteral (" Editor/editorWidthInDFMOnly" ), true ).toBool ());
9991025 ui->vimModeCheckBox ->setChecked (settings.value (QStringLiteral (" Editor/vimMode" )).toBool ());
0 commit comments