Move all code to set default text font into the Config class

This commit is contained in:
Veronica Berglyd Olsen
2023-05-31 17:49:31 +02:00
parent 74f46f4633
commit 704fffada3
13 changed files with 62 additions and 63 deletions
-3
View File
@@ -1258,9 +1258,6 @@ class GuiBuildNovelDocView(QTextBrowser):
))
theFont = QFont()
if CONFIG.textFont is None:
# If none is defined, set the default back to config
CONFIG.textFont = self.document().defaultFont().family()
theFont.setFamily(CONFIG.textFont)
theFont.setPointSize(CONFIG.textSize)
self.setFont(theFont)
+1 -3
View File
@@ -41,7 +41,7 @@ from PyQt5.QtWidgets import (
)
from novelwriter import CONFIG
from novelwriter.constants import nwConst, nwHeadFmt
from novelwriter.constants import nwHeadFmt
from novelwriter.core.buildsettings import BuildSettings, FilterMode
from novelwriter.extensions.switch import NSwitch
from novelwriter.extensions.switchbox import NSwitchBox
@@ -1032,8 +1032,6 @@ class GuiBuildFormatTab(QWidget):
textFont = self._build.getStr("format.textFont")
if not textFont:
textFont = str(CONFIG.textFont)
if not textFont:
textFont = nwConst.SYSTEM_FONT
self.textFont.setText(textFont)
self.textSize.setValue(self._build.getInt("format.textSize"))