Fix theme update in outline view

This commit is contained in:
Veronica Berglyd Olsen
2025-01-11 18:23:14 +01:00
parent 92b6ed2e9e
commit bff341db60
2 changed files with 24 additions and 14 deletions
+3 -2
View File
@@ -90,12 +90,13 @@ class NovelSelector(QComboBox):
@pyqtSlot()
def refreshNovelList(self) -> None:
"""Rebuild the list of novel items."""
cHandle = self.currentData()
self._blockSignal = True
self._firstHandle = None
self.clear()
icon = SHARED.theme.getIcon(nwLabels.CLASS_ICON[nwItemClass.NOVEL], "blue")
handle = self.currentData()
for tHandle, nwItem in SHARED.project.tree.iterRoots(nwItemClass.NOVEL):
if self._listFormat:
name = self._listFormat.format(nwItem.itemName)
@@ -110,7 +111,7 @@ class NovelSelector(QComboBox):
self.insertSeparator(self.count())
self.addItem(icon, self.tr("All Novel Folders"), "")
self.setHandle(handle)
self.setHandle(cHandle)
self.setEnabled(self.count() > 1)
self._blockSignal = False