Use the indenta decorators of the novel tree to indicate type

This commit is contained in:
Veronica Berglyd Olsen
2022-06-15 16:15:29 +02:00
parent 3a061eec3f
commit cff464392a
16 changed files with 393 additions and 31 deletions
+14 -8
View File
@@ -472,9 +472,12 @@ class GuiIcons:
# Switches
"sticky-on", "sticky-off",
"bullet-on", "bullet-off",
# Decorations
"deco_doc_h0", "deco_doc_h1", "deco_doc_h2", "deco_doc_h3", "deco_doc_h4",
}
DECO_MAP = {
IMAGE_MAP = {
"wiz-back": "wizard-back.jpg",
}
@@ -573,19 +576,22 @@ class GuiIcons:
# Access Functions
##
def loadDecoration(self, decoKey, pxW, pxH):
def loadDecoration(self, decoKey, pxW=None, pxH=None):
"""Load graphical decoration element based on the decoration
map. This function always returns a QSwgWidget.
map or the icon map. This function always returns a QPixmap.
"""
if decoKey not in self.DECO_MAP:
if decoKey in self._themeMap:
imgPath = self._themeMap[decoKey]
elif decoKey in self.IMAGE_MAP:
imgPath = os.path.join(
self.mainConf.assetPath, "images", self.IMAGE_MAP[decoKey]
)
else:
logger.error("Decoration with name '%s' does not exist", decoKey)
return QPixmap()
imgPath = os.path.join(
self.mainConf.assetPath, "images", self.DECO_MAP[decoKey]
)
if not os.path.isfile(imgPath):
logger.error("Decoration file '%s' not in assets folder", self.DECO_MAP[decoKey])
logger.error("Asset '%s' not found", self.IMAGE_MAP[decoKey])
return QPixmap()
theDeco = QPixmap(imgPath)