X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/67b53c1cb06988394c35a6e965c99b72b67fe1be..1bc2bfe02d8c6b79b9202471feb13af7f1379372:/skin.py diff --git a/skin.py b/skin.py index 07213915..13d56cf1 100644 --- a/skin.py +++ b/skin.py @@ -88,7 +88,7 @@ def collectAttributes(skinAttributes, node, skin_path_prefix=None, ignore=[]): # TODO: localization? as in e1? value = a.value.encode("utf-8") - if attrib in ["pixmap", "pointer", "seek_pointer"]: + if attrib in ["pixmap", "pointer", "seek_pointer", "backgroundPixmap", "selectionPixmap"]: value = resolveFilename(SCOPE_SKIN_IMAGE, value, path_prefix=skin_path_prefix) if attrib not in ignore: @@ -115,10 +115,15 @@ def applySingleAttribute(guiObject, desktop, attrib, value): guiObject.setFont(parseFont(value)) elif attrib == 'zPosition': guiObject.setZPosition(int(value)) - elif attrib == "pixmap": + elif attrib in ["pixmap", "backgroundPixmap", "selectionPixmap"]: ptr = loadPixmap(value) # this should already have been filename-resolved. desktop.makeCompatiblePixmap(ptr) - guiObject.setPixmap(ptr) + if attrib == "pixmap": + guiObject.setPixmap(ptr) + elif attrib == "backgroundPixmap": + guiObject.setBackgroundPicture(ptr) + elif attrib == "selectionPixmap": + guiObject.setSelectionPicture(ptr) # guiObject.setPixmapFromFile(value) elif attrib == "alphatest": # used by ePixmap guiObject.setAlphatest( @@ -281,9 +286,15 @@ def lookupScreen(name): return None, None def readSkin(screen, skin, name, desktop): - - myscreen, path = lookupScreen(name) - + if not isinstance(name, list): + name = [name] + + # try all skins, first existing one have priority + for n in name: + myscreen, path = lookupScreen(n) + if myscreen is not None: + break + # otherwise try embedded skin myscreen = myscreen or getattr(screen, "parsedSkin", None) @@ -291,7 +302,7 @@ def readSkin(screen, skin, name, desktop): if myscreen is None and getattr(screen, "skin", None): myscreen = screen.parsedSkin = xml.dom.minidom.parseString(screen.skin).childNodes[0] - assert myscreen is not None, "no skin for screen '" + name + "' found!" + assert myscreen is not None, "no skin for screen '" + repr(name) + "' found!" screen.skinAttributes = [ ]