diff options
Diffstat (limited to 'src/browsertab.cpp')
| -rw-r--r-- | src/browsertab.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp index 1455ea8..dfcf517 100644 --- a/src/browsertab.cpp +++ b/src/browsertab.cpp @@ -730,6 +730,7 @@ void BrowserTab::renderPage(const QByteArray &data, const MimeType &mime) this->ui->text_browser->setDocument(document.get()); this->current_document = std::move(document); + this->current_style = std::move(doc_style); this->updatePageMargins(); this->needs_rerender = false; @@ -1315,11 +1316,13 @@ void BrowserTab::setUiDensity(UIDensity density) void BrowserTab::updatePageMargins() { - if (!this->current_document) return; + if (!this->current_document || !this->current_style.text_width_enabled) + return; QTextFrame *root = this->current_document->rootFrame(); QTextFrameFormat fmt = root->frameFormat(); - int margin = std::max((this->width() - 900) / 2, 30); + int margin = std::max((this->width() - this->current_style.text_width) / 2, + this->current_style.margin); fmt.setLeftMargin(margin); fmt.setRightMargin(margin); root->setFrameFormat(fmt); |
