fix
[enigma2.git] / skin.py
diff --git a/skin.py b/skin.py
index 9d4b757168273b00f86dd51fec793661ab09c370..a756db8ab1b384145e9a85f236641601b7884ac1 100644 (file)
--- a/skin.py
+++ b/skin.py
@@ -80,6 +80,14 @@ def applySingleAttribute(guiObject, desktop, attrib, value):
                        desktop.makeCompatiblePixmap(ptr)
                        guiObject.setPixmap(ptr)
                        # guiObject.setPixmapFromFile(value)
+               elif attrib == "orientation": # used by eSlider
+                       try:
+                               guiObject.setOrientation(
+                                       { "orVertical": guiObject.orVertical,
+                                               "orHorizontal": guiObject.orHorizontal
+                                       }[value])
+                       except KeyError:
+                               print "oprientation must be either orVertical or orHorizontal!"
                elif attrib == "valign":
                        try:
                                guiObject.setVAlign(
@@ -146,6 +154,9 @@ def loadSkin(desktop):
        for windowstyle in elementsWithTag(skin.childNodes, "windowstyle"):
                style = eWindowStyleSkinned()
                
+               style.setTitleFont(gFont("Arial", 20));
+               style.setTitleOffset(eSize(20, 5));
+               
                for borderset in elementsWithTag(windowstyle.childNodes, "borderset"):
                        bsName = str(borderset.getAttribute("name"))
                        for pixmap in elementsWithTag(borderset.childNodes, "pixmap"):
@@ -182,7 +193,15 @@ def readSkin(screen, skin, name, desktop):
                        myscreen = x
        del skin
        
-       assert myscreen != None, "no skin for screen '" + name + "' found!"
+       if myscreen is None:
+               # try embedded skin
+               print screen.__dict__
+               if "parsedSkin" in screen.__dict__:
+                       myscreen = screen.parsedSkin
+               elif "skin" in screen.__dict__:
+                       myscreen = screen.parsedSkin = xml.dom.minidom.parseString(screen.skin).childNodes[0]
+       
+       assert myscreen is not None, "no skin for screen '" + name + "' found!"
 
        screen.skinAttributes = [ ]
        collectAttributes(screen.skinAttributes, myscreen)
@@ -236,5 +255,4 @@ def readSkin(screen, skin, name, desktop):
                
                # applyAttributes(guiObject, widget, desktop)
                # guiObject.thisown = 0
-               print screen.additionalWidgets
                screen.additionalWidgets.append(w)