diff options
| author | Mike Skec <skec@protonmail.ch> | 2021-02-16 09:56:14 +1100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-02-16 00:19:29 +0100 |
| commit | 4135e0d368a8181b7422338559bdcd3b214443c4 (patch) | |
| tree | 7447e944f42d00f6196c08d9def78f8fadd6c22e /src/renderers/textstyleinstance.cpp | |
| parent | 5acffd9b549c89670a7af69d613266b8d8120ecd (diff) | |
| download | kristall-4135e0d368a8181b7422338559bdcd3b214443c4.tar.gz | |
Improved blockquotes
Diffstat (limited to 'src/renderers/textstyleinstance.cpp')
| -rw-r--r-- | src/renderers/textstyleinstance.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/renderers/textstyleinstance.cpp b/src/renderers/textstyleinstance.cpp index aaf7ee6..cce6313 100644 --- a/src/renderers/textstyleinstance.cpp +++ b/src/renderers/textstyleinstance.cpp @@ -26,10 +26,11 @@ TextStyleInstance::TextStyleInstance(DocumentStyle const & themed_style) standard_h3.setFont(themed_style.h3_font); standard_h3.setForeground(QBrush(themed_style.h3_color)); - preformatted_format.setNonBreakableLines(true); + blockquote.setFont(themed_style.blockquote_font); + blockquote.setForeground(QBrush(themed_style.blockquote_fgcolor)); + blockquote.setBackground(themed_style.blockquote_bgcolor); - block_quote_format.setIndent(themed_style.indent_bq); - block_quote_format.setBackground(themed_style.blockquote_color); + preformatted_format.setNonBreakableLines(true); // Other alignments auto align = themed_style.justify_text ? Qt::AlignJustify : Qt::AlignLeft; @@ -42,9 +43,15 @@ TextStyleInstance::TextStyleInstance(DocumentStyle const & themed_style) link_format.setLineHeight(themed_style.line_height_p, QTextBlockFormat::LineDistanceHeight); - block_quote_format.setAlignment(align); - block_quote_format.setLineHeight(themed_style.line_height_p, + blockquote_format.setAlignment(align); + blockquote_format.setLineHeight(themed_style.line_height_p, QTextBlockFormat::LineDistanceHeight); + blockquote_tableformat.setBorderStyle(QTextFrameFormat::BorderStyle_None); + blockquote_tableformat.setHeaderRowCount(0); + blockquote_tableformat.setCellPadding(16.0); + blockquote_tableformat.setAlignment(Qt::AlignJustify); + blockquote_tableformat.setLeftMargin(20.0 * themed_style.indent_bq); + blockquote_tableformat.setBottomMargin(20.0); list_format.setStyle(QTextListFormat::ListDisc); list_format.setIndent(themed_style.indent_l); |
