Fix document margin recursion error (#1007)

This commit is contained in:
Veronica Berglyd Olsen
2022-02-24 21:06:28 +01:00
parent be703c1f46
commit 3cdba90bb0
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -1061,8 +1061,8 @@ class GuiDocEditor(QTextEdit):
"""If the text editor is resized, we must make sure the document """If the text editor is resized, we must make sure the document
has its margins adjusted according to user preferences. has its margins adjusted according to user preferences.
""" """
QTextEdit.resizeEvent(self, theEvent)
self.updateDocMargins() self.updateDocMargins()
QTextEdit.resizeEvent(self, theEvent)
return return
## ##
+3 -2
View File
@@ -471,10 +471,11 @@ class GuiDocViewer(QTextBrowser):
## ##
def resizeEvent(self, theEvent): 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() self.updateDocMargins()
QTextBrowser.resizeEvent(self, theEvent)
return return
def mouseReleaseEvent(self, theEvent): def mouseReleaseEvent(self, theEvent):