Update classes and functions to use the item as source of main heading instead of index

This commit is contained in:
Veronica Berglyd Olsen
2022-10-17 20:15:45 +02:00
parent 5a4b7b7264
commit 8fe25d4b43
7 changed files with 15 additions and 19 deletions
+2 -2
View File
@@ -516,7 +516,7 @@ class GuiProjectTree(QTreeWidget):
# Collect some information about the selected item that
pItem = self.theProject.tree[sHandle]
qItem = self._getTreeItem(sHandle)
sLevel = nwHeaders.H_LEVEL.get(self.theProject.index.getHandleHeaderLevel(sHandle), 0)
sLevel = nwHeaders.H_LEVEL.get(pItem.mainHeading, 0)
sIsParent = False if qItem is None else qItem.childCount() > 0
if self.theProject.tree.isTrash(sHandle):
@@ -897,7 +897,7 @@ class GuiProjectTree(QTreeWidget):
return
itemStatus, statusIcon = nwItem.getImportStatus()
hLevel = self.theProject.index.getHandleHeaderLevel(tHandle)
hLevel = nwItem.mainHeading
itemIcon = self.mainTheme.getItemIcon(
nwItem.itemType, nwItem.itemClass, nwItem.itemLayout, hLevel
)