# 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:
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(
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)
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 = [ ]