X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/a072a06516d83d3a11c52544bf2f7cb8ab567b4e..425399841b2657846be038cd0ba8fe449a528691:/skin.py diff --git a/skin.py b/skin.py index 67b461f1..5744855c 100644 --- a/skin.py +++ b/skin.py @@ -14,134 +14,16 @@ def dump(x, i=0): except: None -dom = xml.dom.minidom.parseString( - """ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - """ """ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# this should be factored out into some helper code, but currently demonstrated applets. -from enigma import eSize, ePoint - -orgwidth = self.instance.size().width() -orgpos = self.instance.position() -textsize = self["text"].getSize() - -# y size still must be fixed in font stuff... -textsize = (textsize[0], textsize[1] + 20) -wsize = (textsize[0] + 20, textsize[1] + 20) +# read the skin +try: + # first we search in the current path + skinfile = file('data/skin.xml', 'r') +except: + # if not found in the current path, we use the global datadir-path + skinfile = file('/usr/share/enigma2/skin.xml', 'r') +dom = xml.dom.minidom.parseString(skinfile.read()) +skinfile.close() -# resize -self.instance.resize(eSize(*wsize)) - -# resize label -self["text"].instance.resize(eSize(*textsize)) - -# center window -newwidth = wsize[0] -self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y())) - - - """) def parsePosition(str): x, y = str.split(',') @@ -198,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( @@ -354,5 +244,4 @@ def readSkin(screen, skin, name, desktop): # applyAttributes(guiObject, widget, desktop) # guiObject.thisown = 0 - print screen.additionalWidgets screen.additionalWidgets.append(w)