Updated icons in outline and project tree

This commit is contained in:
Veronica K. B. Olsen
2020-06-09 16:30:58 +02:00
parent e0ea8871d0
commit f14ebb5512
2 changed files with 7 additions and 6 deletions
+4 -3
View File
@@ -371,7 +371,7 @@ class GuiOutline(QTreeWidget):
tLevel = self.theIndex.novelIndex[tHandle][sTitle]["level"]
tTime = self.theIndex.novelIndex[tHandle][sTitle]["updated"]
tItem = self._createTreeItem(tHandle, sTitle)
tItem = self._createTreeItem(tHandle, sTitle, tLevel)
self.treeMap[titleKey] = tItem
if tLevel == "H1":
@@ -410,17 +410,18 @@ class GuiOutline(QTreeWidget):
return
def _createTreeItem(self, tHandle, sTitle):
def _createTreeItem(self, tHandle, sTitle, tLevel):
"""Populate a tree item with all the column values.
"""
nwItem = self.theProject.projTree[tHandle]
novIdx = self.theIndex.novelIndex[tHandle][sTitle]
newItem = QTreeWidgetItem()
hIcon = "doc_%s" % tLevel.lower()
newItem.setText(self.colIndex[nwOutline.TITLE], novIdx["title"])
newItem.setData(self.colIndex[nwOutline.TITLE], Qt.UserRole, tHandle)
newItem.setIcon(self.colIndex[nwOutline.TITLE], self.theTheme.getIcon("hash"))
newItem.setIcon(self.colIndex[nwOutline.TITLE], self.theTheme.getIcon(hIcon))
newItem.setText(self.colIndex[nwOutline.LEVEL], novIdx["level"])
newItem.setText(self.colIndex[nwOutline.LABEL], nwItem.itemName)
newItem.setIcon(self.colIndex[nwOutline.LABEL], self.theTheme.getIcon("proj_document"))
+3 -3
View File
@@ -67,7 +67,7 @@ class GuiProjectTree(QTreeWidget):
self.clearTree()
# Build GUI
iPx = self.theTheme.textIconSize
iPx = self.theTheme.baseIconSize
self.setIconSize(QSize(iPx, iPx))
self.setExpandsOnDoubleClick(True)
self.setIndentation(iPx)
@@ -758,8 +758,8 @@ class GuiProjectTree(QTreeWidget):
self.addTopLevelItem(newItem)
self.orphRoot = newItem
newItem.setExpanded(True)
newItem.setData(self.C_NAME, "")
newItem.setIcon(self.C_NAME, self.theTheme.getIcon("warning"))
newItem.setData(self.C_NAME, Qt.UserRole, "")
newItem.setIcon(self.C_NAME, self.theTheme.getIcon("proj_orphan"))
return
def _cleanOrphanedRoot(self):