Update and reorganise themes (#893)

* Drop the subfolders for GUI themes
* Remove bundled font support
* Add safe file read function
* Allow loading themes from multiple locations
* Clean up unused variables
* Clean up icons class
* Merge icon theme icons
* Update icon theme class
* Remove guiDark config setting
* Fix tests
* Fix handling of default theme
* Update icon readmes
* Add test for getGuiItem common function
This commit is contained in:
Veronica Berglyd Olsen
2021-09-19 14:09:20 +02:00
committed by GitHub
parent be3376272e
commit 15ec1496c5
201 changed files with 482 additions and 2043 deletions
+8 -8
View File
@@ -36,6 +36,8 @@ from PyQt5.QtWidgets import (
QTextBrowser, QLabel
)
from novelwriter.common import readTextFile
logger = logging.getLogger(__name__)
@@ -230,10 +232,9 @@ class GuiAbout(QDialog):
"""Load the content for the Release Notes page.
"""
docPath = os.path.join(self.mainConf.assetPath, "text", "release_notes.htm")
if os.path.isfile(docPath):
with open(docPath, mode="r", encoding="utf-8") as inFile:
helpText = inFile.read()
self.pageNotes.setHtml(helpText)
docText = readTextFile(docPath)
if docText:
self.pageNotes.setHtml(docText)
else:
self.pageNotes.setHtml("Error loading release notes text ...")
return
@@ -242,10 +243,9 @@ class GuiAbout(QDialog):
"""Load the content for the Licence page.
"""
docPath = os.path.join(self.mainConf.assetPath, "text", "gplv3_en.htm")
if os.path.isfile(docPath):
with open(docPath, mode="r", encoding="utf-8") as inFile:
helpText = inFile.read()
self.pageLicense.setHtml(helpText)
docText = readTextFile(docPath)
if docText:
self.pageLicense.setHtml(docText)
else:
self.pageLicense.setHtml("Error loading licence text ...")
return
-12
View File
@@ -203,15 +203,6 @@ class GuiPreferencesGeneral(QWidget):
self.tr("Changing this requires restarting novelWriter.")
)
# Dark Icons
self.guiDark = QSwitch()
self.guiDark.setChecked(self.mainConf.guiDark)
self.mainForm.addRow(
self.tr("Prefer icons for dark backgrounds"),
self.guiDark,
self.tr("May improve the look of icons on dark themes.")
)
# Font Family
self.guiFont = QLineEdit()
self.guiFont.setReadOnly(True)
@@ -284,7 +275,6 @@ class GuiPreferencesGeneral(QWidget):
guiLang = self.guiLang.currentData()
guiTheme = self.guiTheme.currentData()
guiIcons = self.guiIcons.currentData()
guiDark = self.guiDark.isChecked()
guiFont = self.guiFont.text()
guiFontSize = self.guiFontSize.value()
emphLabels = self.emphLabels.isChecked()
@@ -294,7 +284,6 @@ class GuiPreferencesGeneral(QWidget):
needsRestart |= self.mainConf.guiLang != guiLang
needsRestart |= self.mainConf.guiTheme != guiTheme
needsRestart |= self.mainConf.guiIcons != guiIcons
needsRestart |= self.mainConf.guiDark != guiDark
needsRestart |= self.mainConf.guiFont != guiFont
needsRestart |= self.mainConf.guiFontSize != guiFontSize
@@ -305,7 +294,6 @@ class GuiPreferencesGeneral(QWidget):
self.mainConf.guiLang = guiLang
self.mainConf.guiTheme = guiTheme
self.mainConf.guiIcons = guiIcons
self.mainConf.guiDark = guiDark
self.mainConf.guiFont = guiFont
self.mainConf.guiFontSize = guiFontSize
self.mainConf.emphLabels = emphLabels