aboutsummaryrefslogtreecommitdiff
path: root/src/browsertab.cpp
diff options
context:
space:
mode:
authorMike Skec <skec@protonmail.ch>2021-02-13 14:27:46 +1100
committerFelix Queißner <felix@ib-queissner.de>2021-02-13 12:32:26 +0100
commitaeaa90c126b7f56cbbcf6b4ffe2f53db58292a33 (patch)
tree32d33238c04fadeaed04bf4608cf42abb4b23eab /src/browsertab.cpp
parent19ac43503568ebc7fe4721f84292a11bbf7c2c2c (diff)
Margins are now split into seperate horizontal/vertical options
Diffstat (limited to 'src/browsertab.cpp')
-rw-r--r--src/browsertab.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp
index dfcf517..f6684b5 100644
--- a/src/browsertab.cpp
+++ b/src/browsertab.cpp
@@ -6,6 +6,7 @@
#include "renderers/geminirenderer.hpp"
#include "renderers/plaintextrenderer.hpp"
#include "renderers/markdownrenderer.hpp"
+#include "renderers/renderhelpers.hpp"
#include "mimeparser.hpp"
@@ -575,7 +576,7 @@ void BrowserTab::renderPage(const QByteArray &data, const MimeType &mime)
document->setDefaultFont(doc_style.standard_font);
document->setDefaultStyleSheet(doc_style.toStyleSheet());
- document->setDocumentMargin(doc_style.margin);
+ renderhelpers::setPageMargins(document.get(), doc_style.margin_h, doc_style.margin_v);
// Strip inline styles from page, so they don't
// conflict with user styles.
@@ -1322,7 +1323,7 @@ void BrowserTab::updatePageMargins()
QTextFrame *root = this->current_document->rootFrame();
QTextFrameFormat fmt = root->frameFormat();
int margin = std::max((this->width() - this->current_style.text_width) / 2,
- this->current_style.margin);
+ this->current_style.margin_h);
fmt.setLeftMargin(margin);
fmt.setRightMargin(margin);
root->setFrameFormat(fmt);