aboutsummaryrefslogtreecommitdiff
path: root/src/dialogs/settingsdialog.cpp
diff options
context:
space:
mode:
authorMike Skec <skec@protonmail.ch>2021-02-10 19:07:42 +1100
committerFelix Queißner <felix@ib-queissner.de>2021-02-10 10:06:15 +0100
commit3b064297512692ecb96975c5a068ec87d653e7e0 (patch)
treef8239a97d57f0d48ff9c6ee6d3a6f694b3980e8c /src/dialogs/settingsdialog.cpp
parentb1e25a64dee20f7eb5b7fc15414fb69a7b0ace1d (diff)
downloadkristall-3b064297512692ecb96975c5a068ec87d653e7e0.tar.gz
Add preferences for new gemini formatting options
Diffstat (limited to 'src/dialogs/settingsdialog.cpp')
-rw-r--r--src/dialogs/settingsdialog.cpp56
1 files changed, 56 insertions, 0 deletions
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);