From 803559502dd1b330da39073cffa84278df403a88 Mon Sep 17 00:00:00 2001 From: Mike Skec Date: Sun, 28 Feb 2021 10:31:16 +1100 Subject: Add preference for centred H1 Also moves the 'enable text width' checkbox to next to the text width option, to save space. --- src/dialogs/settingsdialog.cpp | 8 +++++++ src/dialogs/settingsdialog.hpp | 2 ++ src/dialogs/settingsdialog.ui | 51 +++++++++++++++++++++++++++--------------- 3 files changed, 43 insertions(+), 18 deletions(-) (limited to 'src/dialogs') diff --git a/src/dialogs/settingsdialog.cpp b/src/dialogs/settingsdialog.cpp index 4bd0f8c..b883970 100644 --- a/src/dialogs/settingsdialog.cpp +++ b/src/dialogs/settingsdialog.cpp @@ -134,6 +134,8 @@ void SettingsDialog::setGeminiStyle(DocumentStyle const &style) this->ui->enable_justify_text->setChecked(this->current_style.justify_text); + this->ui->enable_centre_h1->setChecked(this->current_style.centre_h1); + this->ui->enable_text_width->setChecked(this->current_style.text_width_enabled); this->ui->text_width->setEnabled(this->current_style.text_width_enabled); this->ui->text_width->setValue(this->current_style.text_width); @@ -535,6 +537,12 @@ void SettingsDialog::on_enable_justify_text_clicked(bool checked) this->reloadStylePreview(); } +void SettingsDialog::on_enable_centre_h1_clicked(bool checked) +{ + this->current_style.centre_h1 = checked; + this->reloadStylePreview(); +} + void SettingsDialog::on_enable_text_width_clicked(bool checked) { this->current_style.text_width_enabled = checked; diff --git a/src/dialogs/settingsdialog.hpp b/src/dialogs/settingsdialog.hpp index 114396e..c1ba1c3 100644 --- a/src/dialogs/settingsdialog.hpp +++ b/src/dialogs/settingsdialog.hpp @@ -87,6 +87,8 @@ private slots: void on_enable_text_width_clicked(bool arg1); + void on_enable_centre_h1_clicked(bool arg1); + void on_text_width_valueChanged(int value); void on_line_height_p_valueChanged(double arg1); diff --git a/src/dialogs/settingsdialog.ui b/src/dialogs/settingsdialog.ui index 04db3e2..6c0182d 100644 --- a/src/dialogs/settingsdialog.ui +++ b/src/dialogs/settingsdialog.ui @@ -1108,12 +1108,12 @@ - + - Enable text width limit + Centre first H1 - Whether to limit the width of formatted text on the page or not. + Whether to centre the first top-level heading in the document. @@ -1131,20 +1131,34 @@ - - - 300 - - - 900 - - - 2000 - - - px - - + + + + + 300 + + + 900 + + + 2000 + + + px + + + + + + + Enabled + + + Whether to limit the width of formatted text on the page or not. + + + + @@ -1574,8 +1588,9 @@ page_margin_h page_margin_v enable_justify_text - enable_text_width + enable_centre_h1 text_width + enable_text_width line_height_p line_height_h indent_p -- cgit v1.2.3