hello MiLo thank you for taking part in this discussion. I`m now of the impression that we are making circles:[list]
[*]my picons are exactly 100x60 (like the one in the first post) off course the actual graphic inside is notalways filling the whole 100x60 but this is the point of a transparent picon, right?
[*]the skin.xml is using a 100x60 size for the picon widget - and this is standard for all skins as far as I know
[*]actually swapping a picon.py helped, since Im not able to attach this file here please tak a look at the syntax
[*]of course I`m loosing the recent changes for correctly displaying the picon_default.png when using a non-standard renderer
[/list]
##
from Renderer import Renderer
from enigma import ePixmap
from Tools.Directories import fileExists, SCOPE_SKIN_IMAGE, SCOPE_CURRENT_SKIN, resolveFilename
class Picon(Renderer):
searchPaths = ('/usr/share/enigma2/%s/', '/media/cf/%s/', '/media/usb/%s/', '/media/sdb1/%s/')
def __init__(self):
Renderer.__init__(self)
self.path = "picon"
self.nameCache = { }
self.pngname = ""
def applySkin(self, desktop, parent):
attribs = [ ]
for (attrib, value) in self.skinAttributes:
if attrib == "path":
self.path = value
else:
attribs.append((attrib,value))
self.skinAttributes = attribs
return Renderer.applySkin(self, desktop, parent)
GUI_WIDGET = ePixmap
def changed(self, what):
if self.instance:
pngname = ""
if what[0] != self.CHANGED_CLEAR:
sname = self.source.text
# strip all after last :
pos = sname.rfind(':')
if pos != -1:
sname = sname[:pos].rstrip(':').replace(':','_')
pngname = self.nameCache.get(sname, "")
if pngname == "":
pngname = self.findPicon(sname)
if pngname != "":
self.nameCache[sname] = pngname
if pngname == "": # no picon for service found
pngname = self.nameCache.get("default", "")
if pngname == "": # no default yet in cache..
pngname = self.findPicon("picon_default")
if pngname == "":
tmp = resolveFilename(SCOPE_CURRENT_SKIN, "picon_default.png")
if fileExists(tmp):
pngname = tmp
else:
pngname = resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/picon_default.png")
self.nameCache["default"] = pngname
if self.pngname != pngname:
self.instance.setPixmapFromFile(pngname)
self.pngname = pngname
def findPicon(self, serviceName):
for path in self.searchPaths:
pngname = (path % self.path) + serviceName + ".png"
if fileExists(pngname):
return pngname
return ""
Edited by greatred, 12 February 2012 - 20:00.