From 3cdba90bb04642b7ccf9a182347b172225b51933 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Thu, 24 Feb 2022 21:06:28 +0100 Subject: [PATCH] Fix document margin recursion error (#1007) --- novelwriter/gui/doceditor.py | 2 +- novelwriter/gui/docviewer.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/novelwriter/gui/doceditor.py b/novelwriter/gui/doceditor.py index 41442385..b1760be4 100644 --- a/novelwriter/gui/doceditor.py +++ b/novelwriter/gui/doceditor.py @@ -1061,8 +1061,8 @@ class GuiDocEditor(QTextEdit): """If the text editor is resized, we must make sure the document has its margins adjusted according to user preferences. """ - QTextEdit.resizeEvent(self, theEvent) self.updateDocMargins() + QTextEdit.resizeEvent(self, theEvent) return ## diff --git a/novelwriter/gui/docviewer.py b/novelwriter/gui/docviewer.py index 72c142a0..4ec59570 100644 --- a/novelwriter/gui/docviewer.py +++ b/novelwriter/gui/docviewer.py @@ -471,10 +471,11 @@ class GuiDocViewer(QTextBrowser): ## def resizeEvent(self, theEvent): - """Make sure the document title is the same width as the window. + """If the text editor is resized, we must make sure the document + has its margins adjusted according to user preferences. """ - QTextBrowser.resizeEvent(self, theEvent) self.updateDocMargins() + QTextBrowser.resizeEvent(self, theEvent) return def mouseReleaseEvent(self, theEvent):