Updated icons in outline and project tree
This commit is contained in:
+4
-3
@@ -371,7 +371,7 @@ class GuiOutline(QTreeWidget):
|
|||||||
|
|
||||||
tLevel = self.theIndex.novelIndex[tHandle][sTitle]["level"]
|
tLevel = self.theIndex.novelIndex[tHandle][sTitle]["level"]
|
||||||
tTime = self.theIndex.novelIndex[tHandle][sTitle]["updated"]
|
tTime = self.theIndex.novelIndex[tHandle][sTitle]["updated"]
|
||||||
tItem = self._createTreeItem(tHandle, sTitle)
|
tItem = self._createTreeItem(tHandle, sTitle, tLevel)
|
||||||
self.treeMap[titleKey] = tItem
|
self.treeMap[titleKey] = tItem
|
||||||
|
|
||||||
if tLevel == "H1":
|
if tLevel == "H1":
|
||||||
@@ -410,17 +410,18 @@ class GuiOutline(QTreeWidget):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def _createTreeItem(self, tHandle, sTitle):
|
def _createTreeItem(self, tHandle, sTitle, tLevel):
|
||||||
"""Populate a tree item with all the column values.
|
"""Populate a tree item with all the column values.
|
||||||
"""
|
"""
|
||||||
nwItem = self.theProject.projTree[tHandle]
|
nwItem = self.theProject.projTree[tHandle]
|
||||||
novIdx = self.theIndex.novelIndex[tHandle][sTitle]
|
novIdx = self.theIndex.novelIndex[tHandle][sTitle]
|
||||||
|
|
||||||
newItem = QTreeWidgetItem()
|
newItem = QTreeWidgetItem()
|
||||||
|
hIcon = "doc_%s" % tLevel.lower()
|
||||||
|
|
||||||
newItem.setText(self.colIndex[nwOutline.TITLE], novIdx["title"])
|
newItem.setText(self.colIndex[nwOutline.TITLE], novIdx["title"])
|
||||||
newItem.setData(self.colIndex[nwOutline.TITLE], Qt.UserRole, tHandle)
|
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.LEVEL], novIdx["level"])
|
||||||
newItem.setText(self.colIndex[nwOutline.LABEL], nwItem.itemName)
|
newItem.setText(self.colIndex[nwOutline.LABEL], nwItem.itemName)
|
||||||
newItem.setIcon(self.colIndex[nwOutline.LABEL], self.theTheme.getIcon("proj_document"))
|
newItem.setIcon(self.colIndex[nwOutline.LABEL], self.theTheme.getIcon("proj_document"))
|
||||||
|
|||||||
+3
-3
@@ -67,7 +67,7 @@ class GuiProjectTree(QTreeWidget):
|
|||||||
self.clearTree()
|
self.clearTree()
|
||||||
|
|
||||||
# Build GUI
|
# Build GUI
|
||||||
iPx = self.theTheme.textIconSize
|
iPx = self.theTheme.baseIconSize
|
||||||
self.setIconSize(QSize(iPx, iPx))
|
self.setIconSize(QSize(iPx, iPx))
|
||||||
self.setExpandsOnDoubleClick(True)
|
self.setExpandsOnDoubleClick(True)
|
||||||
self.setIndentation(iPx)
|
self.setIndentation(iPx)
|
||||||
@@ -758,8 +758,8 @@ class GuiProjectTree(QTreeWidget):
|
|||||||
self.addTopLevelItem(newItem)
|
self.addTopLevelItem(newItem)
|
||||||
self.orphRoot = newItem
|
self.orphRoot = newItem
|
||||||
newItem.setExpanded(True)
|
newItem.setExpanded(True)
|
||||||
newItem.setData(self.C_NAME, "")
|
newItem.setData(self.C_NAME, Qt.UserRole, "")
|
||||||
newItem.setIcon(self.C_NAME, self.theTheme.getIcon("warning"))
|
newItem.setIcon(self.C_NAME, self.theTheme.getIcon("proj_orphan"))
|
||||||
return
|
return
|
||||||
|
|
||||||
def _cleanOrphanedRoot(self):
|
def _cleanOrphanedRoot(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user