Update tests and add more debug output
This commit is contained in:
@@ -552,6 +552,8 @@ class NWProject:
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: NWProject")
|
||||||
|
|
||||||
self._data.itemStatus.refreshIcons()
|
self._data.itemStatus.refreshIcons()
|
||||||
self._data.itemImport.refreshIcons()
|
self._data.itemImport.refreshIcons()
|
||||||
|
|
||||||
|
|||||||
@@ -292,6 +292,8 @@ class GuiDocEditor(QPlainTextEdit):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: GuiDocEditor")
|
||||||
|
|
||||||
self.docSearch.updateTheme()
|
self.docSearch.updateTheme()
|
||||||
self.docHeader.updateTheme()
|
self.docHeader.updateTheme()
|
||||||
self.docFooter.updateTheme()
|
self.docFooter.updateTheme()
|
||||||
@@ -2478,8 +2480,9 @@ class GuiDocToolBar(QWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Initialise GUI elements that depend on specific settings."""
|
"""Initialise GUI elements that depend on specific settings."""
|
||||||
syntax = SHARED.theme.syntaxTheme
|
logger.debug("Theme Update: GuiDocToolBar")
|
||||||
|
|
||||||
|
syntax = SHARED.theme.syntaxTheme
|
||||||
palette = self.palette()
|
palette = self.palette()
|
||||||
palette.setColor(QPalette.ColorRole.Window, syntax.back)
|
palette.setColor(QPalette.ColorRole.Window, syntax.back)
|
||||||
palette.setColor(QPalette.ColorRole.WindowText, syntax.text)
|
palette.setColor(QPalette.ColorRole.WindowText, syntax.text)
|
||||||
@@ -2716,8 +2719,9 @@ class GuiDocEditSearch(QFrame):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
palette = QApplication.palette()
|
logger.debug("Theme Update: GuiDocEditSearch")
|
||||||
|
|
||||||
|
palette = QApplication.palette()
|
||||||
self.setPalette(palette)
|
self.setPalette(palette)
|
||||||
self.searchBox.setPalette(palette)
|
self.searchBox.setPalette(palette)
|
||||||
self.replaceBox.setPalette(palette)
|
self.replaceBox.setPalette(palette)
|
||||||
@@ -2961,6 +2965,8 @@ class GuiDocEditHeader(QWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: GuiDocEditHeader")
|
||||||
|
|
||||||
self.tbButton.setThemeIcon("fmt_toolbar", "blue")
|
self.tbButton.setThemeIcon("fmt_toolbar", "blue")
|
||||||
self.outlineButton.setThemeIcon("list", "blue")
|
self.outlineButton.setThemeIcon("list", "blue")
|
||||||
self.searchButton.setThemeIcon("search", "blue")
|
self.searchButton.setThemeIcon("search", "blue")
|
||||||
@@ -3150,6 +3156,8 @@ class GuiDocEditFooter(QWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: GuiDocEditFooter")
|
||||||
|
|
||||||
iPx = round(0.9*SHARED.theme.baseIconHeight)
|
iPx = round(0.9*SHARED.theme.baseIconHeight)
|
||||||
self.linesIcon.setPixmap(SHARED.theme.getPixmap("lines", (iPx, iPx)))
|
self.linesIcon.setPixmap(SHARED.theme.getPixmap("lines", (iPx, iPx)))
|
||||||
self.wordsIcon.setPixmap(SHARED.theme.getPixmap("stats", (iPx, iPx)))
|
self.wordsIcon.setPixmap(SHARED.theme.getPixmap("stats", (iPx, iPx)))
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ class GuiDocViewer(QTextBrowser):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: GuiDocViewer")
|
||||||
self.docHeader.updateTheme()
|
self.docHeader.updateTheme()
|
||||||
self.docFooter.updateTheme()
|
self.docFooter.updateTheme()
|
||||||
|
|
||||||
@@ -724,6 +725,8 @@ class GuiDocViewHeader(QWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: GuiDocViewHeader")
|
||||||
|
|
||||||
self.outlineButton.setThemeIcon("list", "blue")
|
self.outlineButton.setThemeIcon("list", "blue")
|
||||||
self.backButton.setThemeIcon("chevron_left", "blue")
|
self.backButton.setThemeIcon("chevron_left", "blue")
|
||||||
self.forwardButton.setThemeIcon("chevron_right", "blue")
|
self.forwardButton.setThemeIcon("chevron_right", "blue")
|
||||||
@@ -910,7 +913,8 @@ class GuiDocViewFooter(QWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
# Icons
|
logger.debug("Theme Update: GuiDocViewFooter")
|
||||||
|
|
||||||
fPx = int(0.9*SHARED.theme.fontPixelSize)
|
fPx = int(0.9*SHARED.theme.fontPixelSize)
|
||||||
bulletIcon = SHARED.theme.getToggleIcon("bullet", (fPx, fPx), "blue")
|
bulletIcon = SHARED.theme.getToggleIcon("bullet", (fPx, fPx), "blue")
|
||||||
|
|
||||||
|
|||||||
@@ -106,6 +106,8 @@ class GuiDocViewerPanel(QWidget):
|
|||||||
|
|
||||||
def updateTheme(self, updateTabs: bool = True) -> None:
|
def updateTheme(self, updateTabs: bool = True) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: GuiDocViewerPanel")
|
||||||
|
|
||||||
self.optsButton.setThemeIcon("more_vertical")
|
self.optsButton.setThemeIcon("more_vertical")
|
||||||
self.optsButton.setStyleSheet(SHARED.theme.getStyleSheet(STYLES_MIN_TOOLBUTTON))
|
self.optsButton.setStyleSheet(SHARED.theme.getStyleSheet(STYLES_MIN_TOOLBUTTON))
|
||||||
self.mainTabs.setStyleSheet(SHARED.theme.getStyleSheet(STYLES_FLAT_TABS))
|
self.mainTabs.setStyleSheet(SHARED.theme.getStyleSheet(STYLES_FLAT_TABS))
|
||||||
@@ -270,6 +272,8 @@ class _ViewPanelBackRefs(QTreeWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: _ViewPanelBackRefs")
|
||||||
|
|
||||||
self._editIcon = SHARED.theme.getIcon("edit", "green")
|
self._editIcon = SHARED.theme.getIcon("edit", "green")
|
||||||
self._viewIcon = SHARED.theme.getIcon("view", "blue")
|
self._viewIcon = SHARED.theme.getIcon("view", "blue")
|
||||||
for i in range(self.topLevelItemCount()):
|
for i in range(self.topLevelItemCount()):
|
||||||
@@ -400,6 +404,8 @@ class _ViewPanelKeyWords(QTreeWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: _ViewPanelKeyWords")
|
||||||
|
|
||||||
self._classIcon = SHARED.theme.getIcon(nwLabels.CLASS_ICON[self._class], "root")
|
self._classIcon = SHARED.theme.getIcon(nwLabels.CLASS_ICON[self._class], "root")
|
||||||
self._editIcon = SHARED.theme.getIcon("edit", "green")
|
self._editIcon = SHARED.theme.getIcon("edit", "green")
|
||||||
self._viewIcon = SHARED.theme.getIcon("view", "blue")
|
self._viewIcon = SHARED.theme.getIcon("view", "blue")
|
||||||
|
|||||||
@@ -216,6 +216,7 @@ class GuiItemDetails(QWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: GuiItemDetails")
|
||||||
self.updateViewBox(self._handle)
|
self.updateViewBox(self._handle)
|
||||||
|
|
||||||
def updateViewBox(self, tHandle: str | None) -> None:
|
def updateViewBox(self, tHandle: str | None) -> None:
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ class GuiNovelView(QWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: GuiNovelView")
|
||||||
self.novelBar.updateTheme()
|
self.novelBar.updateTheme()
|
||||||
|
|
||||||
def initSettings(self) -> None:
|
def initSettings(self) -> None:
|
||||||
@@ -244,12 +245,12 @@ class GuiNovelToolBar(QWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
# Icons
|
logger.debug("Theme Update: GuiNovelToolBar")
|
||||||
|
|
||||||
self.tbNovel.setThemeIcon("cls_novel", "red")
|
self.tbNovel.setThemeIcon("cls_novel", "red")
|
||||||
self.tbRefresh.setThemeIcon("refresh", "green")
|
self.tbRefresh.setThemeIcon("refresh", "green")
|
||||||
self.tbMore.setThemeIcon("more_vertical")
|
self.tbMore.setThemeIcon("more_vertical")
|
||||||
|
|
||||||
# StyleSheets
|
|
||||||
buttonStyle = SHARED.theme.getStyleSheet(STYLES_MIN_TOOLBUTTON)
|
buttonStyle = SHARED.theme.getStyleSheet(STYLES_MIN_TOOLBUTTON)
|
||||||
self.tbNovel.setStyleSheet(buttonStyle)
|
self.tbNovel.setStyleSheet(buttonStyle)
|
||||||
self.tbRefresh.setStyleSheet(buttonStyle)
|
self.tbRefresh.setStyleSheet(buttonStyle)
|
||||||
|
|||||||
@@ -103,6 +103,8 @@ class GuiOutlineView(QWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: GuiOutlineView")
|
||||||
|
|
||||||
self.outlineBar.updateTheme()
|
self.outlineBar.updateTheme()
|
||||||
self.outlineTree.updateTheme()
|
self.outlineTree.updateTheme()
|
||||||
self.outlineTree.refreshTree(
|
self.outlineTree.refreshTree(
|
||||||
@@ -258,6 +260,8 @@ class GuiOutlineToolBar(QToolBar):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: GuiOutlineToolBar")
|
||||||
|
|
||||||
self.setStyleSheet("QToolBar {border: 0px;}")
|
self.setStyleSheet("QToolBar {border: 0px;}")
|
||||||
self.novelValue.refreshNovelList()
|
self.novelValue.refreshNovelList()
|
||||||
self.aRefresh.setIcon(SHARED.theme.getIcon("refresh", "green"))
|
self.aRefresh.setIcon(SHARED.theme.getIcon("refresh", "green"))
|
||||||
@@ -454,6 +458,8 @@ class GuiOutlineTree(QTreeWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: GuiOutlineTree")
|
||||||
|
|
||||||
iType = nwItemType.FILE
|
iType = nwItemType.FILE
|
||||||
iClass = nwItemClass.NO_CLASS
|
iClass = nwItemClass.NO_CLASS
|
||||||
iLayout = nwItemLayout.DOCUMENT
|
iLayout = nwItemLayout.DOCUMENT
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ class GuiProjectView(QWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: GuiProjectView")
|
||||||
self.projBar.updateTheme()
|
self.projBar.updateTheme()
|
||||||
|
|
||||||
def initSettings(self) -> None:
|
def initSettings(self) -> None:
|
||||||
@@ -346,6 +347,8 @@ class GuiProjectToolBar(QWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: GuiProjectToolBar")
|
||||||
|
|
||||||
buttonStyle = SHARED.theme.getStyleSheet(STYLES_MIN_TOOLBUTTON)
|
buttonStyle = SHARED.theme.getStyleSheet(STYLES_MIN_TOOLBUTTON)
|
||||||
self.tbQuick.setStyleSheet(buttonStyle)
|
self.tbQuick.setStyleSheet(buttonStyle)
|
||||||
self.tbMoveU.setStyleSheet(buttonStyle)
|
self.tbMoveU.setStyleSheet(buttonStyle)
|
||||||
|
|||||||
@@ -158,6 +158,8 @@ class GuiProjectSearch(QWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: GuiProjectSearch")
|
||||||
|
|
||||||
palette = QApplication.palette()
|
palette = QApplication.palette()
|
||||||
colBase = palette.base().color().name(QtHexArgb)
|
colBase = palette.base().color().name(QtHexArgb)
|
||||||
colFocus = palette.highlight().color().name(QtHexArgb)
|
colFocus = palette.highlight().color().name(QtHexArgb)
|
||||||
|
|||||||
@@ -129,8 +129,9 @@ class GuiSideBar(QWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Initialise GUI elements that depend on specific settings."""
|
"""Initialise GUI elements that depend on specific settings."""
|
||||||
buttonStyle = SHARED.theme.getStyleSheet(STYLES_BIG_TOOLBUTTON)
|
logger.debug("Theme Update: GuiSideBar")
|
||||||
|
|
||||||
|
buttonStyle = SHARED.theme.getStyleSheet(STYLES_BIG_TOOLBUTTON)
|
||||||
self.tbProject.setStyleSheet(buttonStyle)
|
self.tbProject.setStyleSheet(buttonStyle)
|
||||||
self.tbNovel.setStyleSheet(buttonStyle)
|
self.tbNovel.setStyleSheet(buttonStyle)
|
||||||
self.tbSearch.setStyleSheet(buttonStyle)
|
self.tbSearch.setStyleSheet(buttonStyle)
|
||||||
|
|||||||
@@ -133,6 +133,8 @@ class GuiMainStatus(QStatusBar):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: GuiMainStatus")
|
||||||
|
|
||||||
iPx = SHARED.theme.baseIconHeight
|
iPx = SHARED.theme.baseIconHeight
|
||||||
self.langIcon.setPixmap(SHARED.theme.getPixmap("language", (iPx, iPx)))
|
self.langIcon.setPixmap(SHARED.theme.getPixmap("language", (iPx, iPx)))
|
||||||
self.statsIcon.setPixmap(SHARED.theme.getPixmap("stats", (iPx, iPx)))
|
self.statsIcon.setPixmap(SHARED.theme.getPixmap("stats", (iPx, iPx)))
|
||||||
|
|||||||
@@ -263,10 +263,7 @@ class GuiManuscript(NToolDialog):
|
|||||||
|
|
||||||
def updateTheme(self, *, init: bool = False) -> None:
|
def updateTheme(self, *, init: bool = False) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
self.tbAdd.setThemeIcon("add", "green")
|
logger.debug("Theme Update: GuiManuscript, init=%s", init)
|
||||||
self.tbDel.setThemeIcon("remove", "red")
|
|
||||||
self.tbCopy.setThemeIcon("copy", "blue")
|
|
||||||
self.tbEdit.setThemeIcon("edit", "green")
|
|
||||||
|
|
||||||
if not init:
|
if not init:
|
||||||
self.btnPreview.updateIcon()
|
self.btnPreview.updateIcon()
|
||||||
@@ -274,6 +271,11 @@ class GuiManuscript(NToolDialog):
|
|||||||
self.btnBuild.updateIcon()
|
self.btnBuild.updateIcon()
|
||||||
self.btnClose.updateIcon()
|
self.btnClose.updateIcon()
|
||||||
|
|
||||||
|
self.tbAdd.setThemeIcon("add", "green")
|
||||||
|
self.tbDel.setThemeIcon("remove", "red")
|
||||||
|
self.tbCopy.setThemeIcon("copy", "blue")
|
||||||
|
self.tbEdit.setThemeIcon("edit", "green")
|
||||||
|
|
||||||
buttonStyle = SHARED.theme.getStyleSheet(STYLES_MIN_TOOLBUTTON)
|
buttonStyle = SHARED.theme.getStyleSheet(STYLES_MIN_TOOLBUTTON)
|
||||||
self.tbAdd.setStyleSheet(buttonStyle)
|
self.tbAdd.setStyleSheet(buttonStyle)
|
||||||
self.tbDel.setStyleSheet(buttonStyle)
|
self.tbDel.setStyleSheet(buttonStyle)
|
||||||
@@ -641,6 +643,7 @@ class _DetailsWidget(QWidget):
|
|||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
if self._build:
|
if self._build:
|
||||||
|
logger.debug("Theme Update: _DetailsWidget")
|
||||||
self.updateInfo(self._build)
|
self.updateInfo(self._build)
|
||||||
|
|
||||||
|
|
||||||
@@ -709,6 +712,7 @@ class _OutlineWidget(QWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: _OutlineWidget")
|
||||||
self.updateOutline(self._outline, force=True)
|
self.updateOutline(self._outline, force=True)
|
||||||
|
|
||||||
##
|
##
|
||||||
@@ -845,6 +849,8 @@ class _PreviewWidget(QTextBrowser):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: _PreviewWidget")
|
||||||
|
|
||||||
palette = QApplication.palette()
|
palette = QApplication.palette()
|
||||||
palette.setColor(QPalette.ColorRole.Window, palette.toolTipBase().color())
|
palette.setColor(QPalette.ColorRole.Window, palette.toolTipBase().color())
|
||||||
palette.setColor(QPalette.ColorRole.WindowText, palette.toolTipText().color())
|
palette.setColor(QPalette.ColorRole.WindowText, palette.toolTipText().color())
|
||||||
@@ -984,6 +990,7 @@ class _StatsWidget(QWidget):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: _StatsWidget")
|
||||||
self.toggleButton.setThemeIcon("unfold")
|
self.toggleButton.setThemeIcon("unfold")
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|||||||
@@ -173,6 +173,8 @@ class GuiBuildSettings(NToolDialog):
|
|||||||
|
|
||||||
def updateTheme(self, *, init: bool = False) -> None:
|
def updateTheme(self, *, init: bool = False) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: GuiBuildSettings, init=%s", init)
|
||||||
|
|
||||||
if not init:
|
if not init:
|
||||||
self.btnApply.updateIcon()
|
self.btnApply.updateIcon()
|
||||||
self.btnSave.updateIcon()
|
self.btnSave.updateIcon()
|
||||||
@@ -405,6 +407,8 @@ class _FilterTab(NFixedPage):
|
|||||||
|
|
||||||
def updateTheme(self, *, init: bool = False) -> None:
|
def updateTheme(self, *, init: bool = False) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: _FilterTab, init=%s", init)
|
||||||
|
|
||||||
if not init:
|
if not init:
|
||||||
self._statusFlags[self.F_FILTERED] = SHARED.theme.getIcon("filter", "orange")
|
self._statusFlags[self.F_FILTERED] = SHARED.theme.getIcon("filter", "orange")
|
||||||
self._statusFlags[self.F_INCLUDED] = SHARED.theme.getIcon("pin", "blue")
|
self._statusFlags[self.F_INCLUDED] = SHARED.theme.getIcon("pin", "blue")
|
||||||
@@ -805,6 +809,8 @@ class _HeadingsTab(NScrollablePage):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
|
logger.debug("Theme Update: _HeadingsTab")
|
||||||
|
|
||||||
self.btnPart.setThemeIcon("edit", "green")
|
self.btnPart.setThemeIcon("edit", "green")
|
||||||
self.btnChapter.setThemeIcon("edit", "green")
|
self.btnChapter.setThemeIcon("edit", "green")
|
||||||
self.btnUnnumbered.setThemeIcon("edit", "green")
|
self.btnUnnumbered.setThemeIcon("edit", "green")
|
||||||
@@ -1310,12 +1316,13 @@ class _FormattingTab(NScrollableForm):
|
|||||||
|
|
||||||
def updateTheme(self) -> None:
|
def updateTheme(self) -> None:
|
||||||
"""Update theme elements."""
|
"""Update theme elements."""
|
||||||
iPx = SHARED.theme.baseIconHeight
|
logger.debug("Theme Update: _FormattingTab")
|
||||||
|
|
||||||
self.ignoredKeywordsButton.setThemeIcon("add", "green")
|
self.ignoredKeywordsButton.setThemeIcon("add", "green")
|
||||||
self.btnTextFont.setThemeIcon("font")
|
self.btnTextFont.setThemeIcon("font")
|
||||||
self.btnPageHeader.setThemeIcon("revert", "green")
|
self.btnPageHeader.setThemeIcon("revert", "green")
|
||||||
|
|
||||||
|
iPx = SHARED.theme.baseIconHeight
|
||||||
self.pixT.setPixmap(SHARED.theme.getPixmap("margin_top", (iPx, iPx)))
|
self.pixT.setPixmap(SHARED.theme.getPixmap("margin_top", (iPx, iPx)))
|
||||||
self.pixB.setPixmap(SHARED.theme.getPixmap("margin_bottom", (iPx, iPx)))
|
self.pixB.setPixmap(SHARED.theme.getPixmap("margin_bottom", (iPx, iPx)))
|
||||||
self.pixL.setPixmap(SHARED.theme.getPixmap("margin_left", (iPx, iPx)))
|
self.pixL.setPixmap(SHARED.theme.getPixmap("margin_left", (iPx, iPx)))
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ def testToolManuscript_Init(monkeypatch, qtbot, nwGUI, projPath, mockRnd):
|
|||||||
manus.btnPreview.click()
|
manus.btnPreview.click()
|
||||||
assert manus.docPreview.toPlainText().strip() == allText
|
assert manus.docPreview.toPlainText().strip() == allText
|
||||||
|
|
||||||
|
# Trigger a theme update, which is only a visual refresh, but it shouldn't crash
|
||||||
|
manus.updateTheme()
|
||||||
|
|
||||||
nwGUI.closeProject() # This should auto-close the manuscript tool
|
nwGUI.closeProject() # This should auto-close the manuscript tool
|
||||||
|
|
||||||
# qtbot.stop()
|
# qtbot.stop()
|
||||||
@@ -148,6 +151,9 @@ def testToolManuscript_Builds(qtbot, nwGUI, projPath):
|
|||||||
assert new is not None
|
assert new is not None
|
||||||
assert new.name == "Test Build 2"
|
assert new.name == "Test Build 2"
|
||||||
|
|
||||||
|
# Trigger a theme update, which should propagate to settings
|
||||||
|
manus.updateTheme()
|
||||||
|
|
||||||
# Close the dialog should also close the child dialogs
|
# Close the dialog should also close the child dialogs
|
||||||
manus.btnClose.click()
|
manus.btnClose.click()
|
||||||
if isinstance(bSettings, GuiBuildSettings):
|
if isinstance(bSettings, GuiBuildSettings):
|
||||||
|
|||||||
Reference in New Issue
Block a user