From 19ac43503568ebc7fe4721f84292a11bbf7c2c2c Mon Sep 17 00:00:00 2001 From: Mike Skec Date: Sat, 13 Feb 2021 13:57:35 +1100 Subject: Adds per-style pref for text width --- src/dialogs/settingsdialog.cpp | 15 ++++++++++ src/dialogs/settingsdialog.hpp | 4 +++ src/dialogs/settingsdialog.ui | 67 ++++++++++++++++++++++++++++++++++-------- 3 files changed, 73 insertions(+), 13 deletions(-) (limited to 'src/dialogs') diff --git a/src/dialogs/settingsdialog.cpp b/src/dialogs/settingsdialog.cpp index 16c74aa..1bbdcf3 100644 --- a/src/dialogs/settingsdialog.cpp +++ b/src/dialogs/settingsdialog.cpp @@ -114,6 +114,10 @@ void SettingsDialog::setGeminiStyle(DocumentStyle const &style) this->ui->enable_justify_text->setChecked(this->current_style.justify_text); + this->ui->enable_text_width->setChecked(this->current_style.text_width_enabled); + + this->ui->text_width->setValue(this->current_style.text_width); + this->ui->line_height_p->setValue(this->current_style.line_height_p); this->ui->line_height_h->setValue(this->current_style.line_height_h); @@ -445,6 +449,17 @@ void SettingsDialog::on_enable_justify_text_clicked(bool checked) this->reloadStylePreview(); } +void SettingsDialog::on_enable_text_width_clicked(bool checked) +{ + this->current_style.text_width_enabled = checked; + this->ui->text_width->setEnabled(checked); +} + +void SettingsDialog::on_text_width_valueChanged(int value) +{ + this->current_style.text_width = value; +} + void SettingsDialog::on_line_height_p_valueChanged(double value) { this->current_style.line_height_p = value; diff --git a/src/dialogs/settingsdialog.hpp b/src/dialogs/settingsdialog.hpp index ff558f6..4032129 100644 --- a/src/dialogs/settingsdialog.hpp +++ b/src/dialogs/settingsdialog.hpp @@ -80,6 +80,10 @@ private slots: void on_enable_justify_text_clicked(bool arg1); + void on_enable_text_width_clicked(bool arg1); + + void on_text_width_valueChanged(int value); + void on_line_height_p_valueChanged(double arg1); void on_line_height_h_valueChanged(double arg1); diff --git a/src/dialogs/settingsdialog.ui b/src/dialogs/settingsdialog.ui index 2193656..b1c0684 100644 --- a/src/dialogs/settingsdialog.ui +++ b/src/dialogs/settingsdialog.ui @@ -930,16 +930,54 @@ + + + + Enable text width limit + + + Whether to limit the width of formatted text on the page or not. + + + + + + + Text width limit + + + Preferred width of formatted text on the page. + + + + + + + 300 + + + 900 + + + 2000 + + + px + + + + + Line height (paragraph) - + px @@ -952,14 +990,15 @@ - + + Line height (header) - + px @@ -973,14 +1012,14 @@ - + Indentation - + @@ -1070,7 +1109,14 @@ - + + + + Presets + + + + @@ -1146,13 +1192,6 @@ - - - - Presets - - - @@ -1305,6 +1344,8 @@ auto_theme page_margin enable_justify_text + enable_text_width + text_width line_height_p line_height_h indent_p -- cgit v1.2.3