From 3b064297512692ecb96975c5a068ec87d653e7e0 Mon Sep 17 00:00:00 2001 From: Mike Skec Date: Wed, 10 Feb 2021 19:07:42 +1100 Subject: Add preferences for new gemini formatting options --- src/dialogs/settingsdialog.cpp | 56 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'src/dialogs/settingsdialog.cpp') diff --git a/src/dialogs/settingsdialog.cpp b/src/dialogs/settingsdialog.cpp index 229a728..d979bbe 100644 --- a/src/dialogs/settingsdialog.cpp +++ b/src/dialogs/settingsdialog.cpp @@ -107,8 +107,21 @@ void SettingsDialog::setGeminiStyle(DocumentStyle const &style) this->ui->auto_theme->setCurrentIndex(this->current_style.theme); + this->ui->link_local_prefix->setText(this->current_style.internal_link_prefix); + this->ui->link_foreign_prefix->setText(this->current_style.external_link_prefix); + this->ui->page_margin->setValue(this->current_style.margin); + this->ui->enable_justify_text->setChecked(this->current_style.justify_text); + + this->ui->line_height_p->setValue(this->current_style.line_height_p); + this->ui->line_height_h->setValue(this->current_style.line_height_h); + + this->ui->indent_bq->setValue(this->current_style.indent_bq); + this->ui->indent_p->setValue(this->current_style.indent_p); + this->ui->indent_h->setValue(this->current_style.indent_h); + this->ui->indent_l->setValue(this->current_style.indent_l); + auto setFontAndColor = [this](QLabel * label, const QFont &font, QColor color) { label->setText(formatFont(font)); @@ -420,6 +433,49 @@ void SettingsDialog::on_page_margin_valueChanged(double value) this->reloadStylePreview(); } +void SettingsDialog::on_enable_justify_text_clicked(bool checked) +{ + this->current_style.justify_text = checked; + this->reloadStylePreview(); +} + +void SettingsDialog::on_line_height_p_valueChanged(double value) +{ + this->current_style.line_height_p = value; + this->reloadStylePreview(); +} + +void SettingsDialog::on_line_height_h_valueChanged(double value) +{ + this->current_style.line_height_h = value; + this->reloadStylePreview(); +} + +void SettingsDialog::on_indent_bq_valueChanged(int value) +{ + this->current_style.indent_bq = value; + this->reloadStylePreview(); +} + +void SettingsDialog::on_indent_h_valueChanged(int value) +{ + this->current_style.indent_h = value; + this->reloadStylePreview(); +} + +void SettingsDialog::on_indent_p_valueChanged(int value) +{ + this->current_style.indent_p = value; + this->reloadStylePreview(); +} + +void SettingsDialog::on_indent_l_valueChanged(int value) +{ + this->current_style.indent_l = value; + this->reloadStylePreview(); +} + + void SettingsDialog::on_presets_currentIndexChanged(int index) { this->ui->preset_load->setEnabled(index >= 0); -- cgit v1.2.3