Some code flow improvements and main GUI test coverage

This commit is contained in:
Veronica Berglyd Olsen
2024-10-31 00:07:48 +01:00
parent a2b09fdfec
commit 0ba0674b9e
4 changed files with 134 additions and 53 deletions
+4 -8
View File
@@ -553,17 +553,13 @@ class GuiNovelTree(QTreeWidget):
if pHandle := self._actHandle:
for key, item in self._treeMap.items():
if key.startswith(pHandle):
item.setBackground(self.C_TITLE, brushOff)
item.setBackground(self.C_WORDS, brushOff)
item.setBackground(self.C_EXTRA, brushOff)
item.setBackground(self.C_MORE, brushOff)
for i in range(self.columnCount()):
item.setBackground(i, brushOff)
if tHandle:
for key, item in self._treeMap.items():
if key.startswith(tHandle):
item.setBackground(self.C_TITLE, brushOn)
item.setBackground(self.C_WORDS, brushOn)
item.setBackground(self.C_EXTRA, brushOn)
item.setBackground(self.C_MORE, brushOn)
for i in range(self.columnCount()):
item.setBackground(i, brushOn)
if not didScroll:
self.scrollToItem(item, QAbstractItemView.ScrollHint.PositionAtCenter)
didScroll = True