diff options
| author | Mike Skec <skec@protonmail.ch> | 2021-02-13 14:27:46 +1100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-02-13 12:32:26 +0100 |
| commit | aeaa90c126b7f56cbbcf6b4ffe2f53db58292a33 (patch) | |
| tree | 32d33238c04fadeaed04bf4608cf42abb4b23eab /src/dialogs | |
| parent | 19ac43503568ebc7fe4721f84292a11bbf7c2c2c (diff) | |
| download | kristall-aeaa90c126b7f56cbbcf6b4ffe2f53db58292a33.tar.gz | |
Margins are now split into seperate horizontal/vertical options
Diffstat (limited to 'src/dialogs')
| -rw-r--r-- | src/dialogs/settingsdialog.cpp | 13 | ||||
| -rw-r--r-- | src/dialogs/settingsdialog.hpp | 3 | ||||
| -rw-r--r-- | src/dialogs/settingsdialog.ui | 54 |
3 files changed, 51 insertions, 19 deletions
diff --git a/src/dialogs/settingsdialog.cpp b/src/dialogs/settingsdialog.cpp index 1bbdcf3..252c7a6 100644 --- a/src/dialogs/settingsdialog.cpp +++ b/src/dialogs/settingsdialog.cpp @@ -110,7 +110,8 @@ void SettingsDialog::setGeminiStyle(DocumentStyle const &style) 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->page_margin_h->setValue(this->current_style.margin_h); + this->ui->page_margin_v->setValue(this->current_style.margin_v); this->ui->enable_justify_text->setChecked(this->current_style.justify_text); @@ -437,9 +438,15 @@ void SettingsDialog::on_preview_url_textChanged(const QString &) this->reloadStylePreview(); } -void SettingsDialog::on_page_margin_valueChanged(double value) +void SettingsDialog::on_page_margin_h_valueChanged(double value) { - this->current_style.margin = value; + this->current_style.margin_h = value; + this->reloadStylePreview(); +} + +void SettingsDialog::on_page_margin_v_valueChanged(double value) +{ + this->current_style.margin_v = value; this->reloadStylePreview(); } diff --git a/src/dialogs/settingsdialog.hpp b/src/dialogs/settingsdialog.hpp index 4032129..d515242 100644 --- a/src/dialogs/settingsdialog.hpp +++ b/src/dialogs/settingsdialog.hpp @@ -76,7 +76,8 @@ private slots: void on_preview_url_textChanged(const QString &arg1); - void on_page_margin_valueChanged(double arg1); + void on_page_margin_h_valueChanged(double arg1); + void on_page_margin_v_valueChanged(double arg1); void on_enable_justify_text_clicked(bool arg1); diff --git a/src/dialogs/settingsdialog.ui b/src/dialogs/settingsdialog.ui index b1c0684..a88285e 100644 --- a/src/dialogs/settingsdialog.ui +++ b/src/dialogs/settingsdialog.ui @@ -891,15 +891,16 @@ <item row="12" column="1"> <widget class="QComboBox" name="auto_theme"/> </item> + <item row="13" column="0"> <widget class="QLabel" name="label_13"> <property name="text"> - <string>Page Margin</string> + <string>Left/right Page Margin</string> </property> </widget> </item> <item row="13" column="1"> - <widget class="QDoubleSpinBox" name="page_margin"> + <widget class="QDoubleSpinBox" name="page_margin_h"> <property name="suffix"> <string> px</string> </property> @@ -907,18 +908,40 @@ <number>0</number> </property> <property name="maximum"> - <double>350.000000000000000</double> + <double>350</double> </property> </widget> </item> + <item row="14" column="0"> + <widget class="QLabel" name="label_32"> + <property name="text"> + <string>Top/bottom Page Margin</string> + </property> + </widget> + </item> + <item row="14" column="1"> + <widget class="QDoubleSpinBox" name="page_margin_v"> + <property name="suffix"> + <string> px</string> + </property> + <property name="decimals"> + <number>0</number> + </property> + <property name="maximum"> + <double>350</double> + </property> + </widget> + </item> + + <item row="15" column="0"> <widget class="QLabel" name="label_25"> <property name="text"> <string>Other options</string> </property> </widget> </item> - <item row="14" column="1"> + <item row="15" column="1"> <layout class="QHBoxLayout" name="horizontalLayout_98"> <item> <widget class="QCheckBox" name="enable_justify_text"> @@ -943,7 +966,7 @@ </layout> </item> - <item row="15" column="0"> + <item row="16" column="0"> <widget class="QLabel" name="label_38"> <property name="text"> <string>Text width limit</string> @@ -953,7 +976,7 @@ </property> </widget> </item> - <item row="15" column="1"> + <item row="16" column="1"> <widget class="QSpinBox" name="text_width"> <property name="minimum"> <number>300</number> @@ -970,14 +993,14 @@ </widget> </item> - <item row="16" column="0"> + <item row="17" column="0"> <widget class="QLabel" name="label_35"> <property name="text"> <string>Line height (paragraph)</string> </property> </widget> </item> - <item row="16" column="1"> + <item row="17" column="1"> <widget class="QDoubleSpinBox" name="line_height_p"> <property name="suffix"> <string> px</string> @@ -991,14 +1014,14 @@ </widget> </item> - <item row="17" column="0"> + <item row="18" column="0"> <widget class="QLabel" name="label_36"> <property name="text"> <string>Line height (header)</string> </property> </widget> </item> - <item row="17" column="1"> + <item row="18" column="1"> <widget class="QDoubleSpinBox" name="line_height_h"> <property name="suffix"> <string> px</string> @@ -1012,14 +1035,14 @@ </widget> </item> - <item row="18" column="0"> + <item row="19" column="0"> <widget class="QLabel" name="label_37"> <property name="text"> <string>Indentation</string> </property> </widget> </item> - <item row="18" column="1"> + <item row="19" column="1"> <layout class="QHBoxLayout" name="indent_container"> <item> @@ -1109,14 +1132,14 @@ </layout> </item> - <item row="19" column="0"> + <item row="20" column="0"> <widget class="QLabel" name="label_17"> <property name="text"> <string>Presets</string> </property> </widget> </item> - <item row="19" column="1"> + <item row="20" column="1"> <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> <widget class="QComboBox" name="presets"/> @@ -1342,7 +1365,8 @@ <tabstop>link_foreign_prefix</tabstop> <tabstop>quote_change_color</tabstop> <tabstop>auto_theme</tabstop> - <tabstop>page_margin</tabstop> + <tabstop>page_margin_h</tabstop> + <tabstop>page_margin_v</tabstop> <tabstop>enable_justify_text</tabstop> <tabstop>enable_text_width</tabstop> <tabstop>text_width</tabstop> |
