aboutsummaryrefslogtreecommitdiff
path: root/src/renderers/textstyleinstance.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/renderers/textstyleinstance.cpp
parentb1e25a64dee20f7eb5b7fc15414fb69a7b0ace1d (diff)
downloadkristall-3b064297512692ecb96975c5a068ec87d653e7e0.tar.gz
Add preferences for new gemini formatting options
Diffstat (limited to 'src/renderers/textstyleinstance.cpp')
-rw-r--r--src/renderers/textstyleinstance.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/renderers/textstyleinstance.cpp b/src/renderers/textstyleinstance.cpp
index 0a99625..aaf7ee6 100644
--- a/src/renderers/textstyleinstance.cpp
+++ b/src/renderers/textstyleinstance.cpp
@@ -28,24 +28,30 @@ TextStyleInstance::TextStyleInstance(DocumentStyle const & themed_style)
preformatted_format.setNonBreakableLines(true);
- block_quote_format.setIndent(2);
+ block_quote_format.setIndent(themed_style.indent_bq);
block_quote_format.setBackground(themed_style.blockquote_color);
// Other alignments
- standard_format.setAlignment(Qt::AlignJustify);
- standard_format.setLineHeight(5, QTextBlockFormat::LineDistanceHeight);
- standard_format.setIndent(1);
+ auto align = themed_style.justify_text ? Qt::AlignJustify : Qt::AlignLeft;
- link_format.setLineHeight(5, QTextBlockFormat::LineDistanceHeight);
+ standard_format.setAlignment(align);
+ standard_format.setLineHeight(themed_style.line_height_p,
+ QTextBlockFormat::LineDistanceHeight);
+ standard_format.setIndent(themed_style.indent_p);
- block_quote_format.setAlignment(Qt::AlignJustify);
- block_quote_format.setLineHeight(5, QTextBlockFormat::LineDistanceHeight);
+ link_format.setLineHeight(themed_style.line_height_p,
+ QTextBlockFormat::LineDistanceHeight);
- list_format.setAlignment(Qt::AlignJustify);
- list_format.setLineHeight(5, QTextBlockFormat::LineDistanceHeight);
- list_format.setIndent(2);
+ block_quote_format.setAlignment(align);
+ block_quote_format.setLineHeight(themed_style.line_height_p,
+ QTextBlockFormat::LineDistanceHeight);
- preformatted_format.setIndent(1);
+ list_format.setStyle(QTextListFormat::ListDisc);
+ list_format.setIndent(themed_style.indent_l);
- heading_format.setLineHeight(0, QTextBlockFormat::LineDistanceHeight);
+ preformatted_format.setIndent(themed_style.indent_p);
+
+ heading_format.setLineHeight(themed_style.line_height_h,
+ QTextBlockFormat::LineDistanceHeight);
+ heading_format.setIndent(themed_style.indent_h);
}