Add a header structure record to the editor, and force an update of te novel tree if header levels change

This commit is contained in:
Veronica K. B. Olsen
2021-02-01 22:49:11 +01:00
parent af21f3c5d8
commit d0940708b0
2 changed files with 42 additions and 1 deletions
+9
View File
@@ -150,6 +150,15 @@ class GuiNovelTree(QTreeWidget):
return
def updateWordCounts(self, tHandle):
"""Update the word count for a given handle.
"""
tHeaders = self.theIndex.getHandleWordCounts(tHandle)
for titleKey, wCount in tHeaders:
if titleKey in self._treeMap:
self._treeMap[titleKey].setText(self.C_WORDS, f"{wCount:n}")
return
def getColumnSizes(self):
"""Return the column widths for the tree columns.
"""