Save all font info for GUI font

This commit is contained in:
Veronica Berglyd Olsen
2024-05-20 16:12:27 +02:00
parent 0bc8a63ccf
commit c0673b8128
5 changed files with 83 additions and 79 deletions
-24
View File
@@ -114,9 +114,6 @@ class GuiTheme:
# Class Setup
# ===========
# Init GUI Font
self._setGuiFont()
# Load Themes
self._guiPalette = QPalette()
self._themeList: list[tuple[str, str]] = []
@@ -411,27 +408,6 @@ class GuiTheme:
self.errorText = QColor(255, 0, 0)
return
def _setGuiFont(self) -> None:
"""Update the GUI's font style from settings."""
font = QFont()
fontDB = QFontDatabase()
if CONFIG.guiFont not in fontDB.families():
if CONFIG.osWindows and "Arial" in fontDB.families():
# On Windows we default to Arial if possible
font.setFamily("Arial")
font.setPointSize(10)
else:
font = fontDB.systemFont(QFontDatabase.SystemFont.GeneralFont)
CONFIG.guiFont = font.family()
CONFIG.guiFontSize = font.pointSize()
else:
font.setFamily(CONFIG.guiFont)
font.setPointSize(CONFIG.guiFontSize)
QApplication.setFont(font)
return
def _listConf(self, targetDict: dict, checkDir: Path) -> bool:
"""Scan for theme config files and populate the dictionary."""
if not checkDir.is_dir():