From 3b064297512692ecb96975c5a068ec87d653e7e0 Mon Sep 17 00:00:00 2001 From: Mike Skec Date: Wed, 10 Feb 2021 19:07:42 +1100 Subject: Add preferences for new gemini formatting options --- src/documentstyle.cpp | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'src/documentstyle.cpp') 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: -- cgit v1.2.3