Fix a bug with editor init on preferences update

This commit is contained in:
Veronica Berglyd Olsen
2024-01-08 22:13:33 +01:00
parent 2504965f8d
commit 944e2455d5
2 changed files with 16 additions and 15 deletions
+7 -7
View File
@@ -142,10 +142,10 @@ class GuiDocViewer(QTextBrowser):
self._makeStyleSheet()
# Set Font
textFont = QFont()
textFont.setFamily(CONFIG.textFont)
textFont.setPointSize(CONFIG.textSize)
self.setFont(textFont)
font = QFont()
font.setFamily(CONFIG.textFont)
font.setPointSize(CONFIG.textSize)
self.setFont(font)
# Set the widget colours to match syntax theme
mainPalette = self.palette()
@@ -164,10 +164,10 @@ class GuiDocViewer(QTextBrowser):
# Set default text margins
self.document().setDocumentMargin(0)
theOpt = QTextOption()
options = QTextOption()
if CONFIG.doJustify:
theOpt.setAlignment(Qt.AlignmentFlag.AlignJustify)
self.document().setDefaultTextOption(theOpt)
options.setAlignment(Qt.AlignmentFlag.AlignJustify)
self.document().setDefaultTextOption(options)
# Scroll bars
if CONFIG.hideVScroll: