aboutsummaryrefslogtreecommitdiff
path: root/src/documentstyle.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/documentstyle.cpp
parentb1e25a64dee20f7eb5b7fc15414fb69a7b0ace1d (diff)
downloadkristall-3b064297512692ecb96975c5a068ec87d653e7e0.tar.gz
Add preferences for new gemini formatting options
Diffstat (limited to 'src/documentstyle.cpp')
-rw-r--r--src/documentstyle.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/documentstyle.cpp b/src/documentstyle.cpp
index 474f947..e6642a2 100644
--- a/src/documentstyle.cpp
+++ b/src/documentstyle.cpp
@@ -138,7 +138,11 @@ DocumentStyle::DocumentStyle(bool do_init) : theme(Fixed),
ansi_colors({"black", "darkred", "darkgreen", "darkgoldenrod",
"darkblue", "darkmagenta", "darkcyan", "lightgray",
"gray", "red", "green", "goldenrod",
- "lightblue", "magenta", "cyan", "white"})
+ "lightblue", "magenta", "cyan", "white"}),
+ justify_text(true),
+ line_height_p(5.0),
+ line_height_h(0.0),
+ indent_bq(2), indent_p(1), indent_h(0), indent_l(2)
{
if (do_init) this->initialiseDefaultFonts();
}
@@ -265,6 +269,19 @@ bool DocumentStyle::save(QSettings &settings) const
settings.endGroup();
}
+ {
+ settings.beginGroup("Formatting");
+
+ settings.setValue("justify_text", justify_text);
+ settings.setValue("line_height_p", line_height_p);
+ settings.setValue("line_height_h", line_height_h);
+ settings.setValue("indent_bq", indent_bq);
+ settings.setValue("indent_p", indent_p);
+ settings.setValue("indent_h", indent_h);
+ settings.setValue("indent_l", indent_l);
+
+ settings.endGroup();
+ }
return true;
}
@@ -357,6 +374,19 @@ bool DocumentStyle::load(QSettings &settings)
settings.endGroup();
}
+ {
+ settings.beginGroup("Formatting");
+
+ justify_text = settings.value("justify_text", justify_text).toBool();
+ line_height_p = settings.value("line_height_p", line_height_p).toDouble();
+ line_height_h = settings.value("line_height_h", line_height_h).toDouble();
+ indent_bq = settings.value("indent_bq", indent_bq).toInt();
+ indent_p = settings.value("indent_p", indent_p).toInt();
+ indent_h = settings.value("indent_h", indent_h).toInt();
+ indent_l = settings.value("indent_l", indent_l).toInt();
+
+ settings.endGroup();
+ }
} break;
default: