Skip to content

Commit

Permalink
[MultiContentTemplateParser]
Browse files Browse the repository at this point in the history
* add missing borderColorSelected
* fix missing item index
  • Loading branch information
jbleyel committed Jan 19, 2025
1 parent fcc8dc9 commit 7c4cb83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/python/Components/Converter/XmlMultiContent.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def parseTemplateModes(template):
modeData = []
for item in modesItems[modeName]:
index = item.get("index", "-1")
if index.isdigit():
if index.isdigit() or index == "-1":
index = int(index)
elif self.indexNames:
index = self.indexNames.get(index, -1)
Expand All @@ -84,6 +84,7 @@ def parseTemplateModes(template):
backgroundColor = item.get("backgroundColor")
backgroundColorSelected = item.get("backgroundColorSelected")
borderColor = item.get("borderColor")
borderColorSelected = item.get("borderColorSelected")
borderWidth = int(item.get("borderWidth", "0"))
cornerRadius, cornerEdges = item.get("_radius", (0, 0))
flags = item.get("_flags", 0)
Expand All @@ -109,7 +110,7 @@ def parseTemplateModes(template):
else:
modeData.append((eListboxPythonMultiContent.TYPE_LINEAR_GRADIENT, pos[0], pos[1], size[0], size[1], gradientDirection, gradientStart, gradientMid, gradientEnd, gradientStartSelected, gradientMidSelected, gradientEndSelected, cornerRadius, cornerEdges))
else:
modeData.append((eListboxPythonMultiContent.TYPE_RECT, pos[0], pos[1], size[0], size[1], backgroundColor, backgroundColorSelected, borderWidth, borderColor, cornerRadius, cornerEdges))
modeData.append((eListboxPythonMultiContent.TYPE_RECT, pos[0], pos[1], size[0], size[1], backgroundColor, backgroundColorSelected, borderWidth, borderColor, borderColorSelected, cornerRadius, cornerEdges))
case "progress":
if index == -1:
index = None
Expand Down
2 changes: 1 addition & 1 deletion lib/python/skin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1916,7 +1916,7 @@ def getGradient(self, foregroundGradient, foregroundGradientSelected):
def collectColors(self, attributes, widgetColors=None):
if widgetColors is None:
widgetColors = ()
for color in ("backgroundColor", "backgroundColorMarked", "backgroundColorMarkedAndSelected", "backgroundColorSelected", "borderColor", "foregroundColor", "foregroundColorMarked", "foregroundColorMarkedAndSelected", "foregroundColorSelected") + widgetColors:
for color in ("backgroundColor", "backgroundColorMarked", "backgroundColorMarkedAndSelected", "backgroundColorSelected", "borderColor", "borderColorSelected", "foregroundColor", "foregroundColorMarked", "foregroundColorMarkedAndSelected", "foregroundColorSelected") + widgetColors:
translatedColor = self.resolveColor(attributes.get(color))
if translatedColor is not None:
attributes[color] = translatedColor
Expand Down

0 comments on commit 7c4cb83

Please sign in to comment.