for EPGList added skin parameters setEventItemFont and setEventTimeFont
authorims <ims21@users.sourceforge.net>
Mon, 12 Jan 2015 14:40:03 +0000 (15:40 +0100)
committerlittlesat <littlesat99@yahoo.com>
Mon, 12 Jan 2015 15:39:38 +0000 (16:39 +0100)
Signed-off-by: littlesat <littlesat99@yahoo.com>

lib/python/Components/EpgList.py

index be3c880..748d1c1 100644 (file)
@@ -11,6 +11,7 @@ from time import localtime, time
 from Components.config import config
 from ServiceReference import ServiceReference
 from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN
+from skin import parseFont
 
 EPG_TYPE_SINGLE = 0
 EPG_TYPE_MULTI = 1
@@ -46,8 +47,8 @@ class EPGList(HTMLComponent, GUIComponent):
                GUIComponent.__init__(self)
                self.type=type
                self.l = eListboxPythonMultiContent()
-               self.l.setFont(0, gFont("Regular", 22))
-               self.l.setFont(1, gFont("Regular", 16))
+               self.eventItemFont = gFont("Regular", 22)
+               self.eventTimeFont = gFont("Regular", 16)
                self.dy = 0
                if type == EPG_TYPE_SINGLE:
                        self.l.setBuildFunc(self.buildSingleEntry)
@@ -340,7 +341,7 @@ class EPGList(HTMLComponent, GUIComponent):
 
        def fillSimilarList(self, refstr, event_id):
                t = time()
-        # search similar broadcastings
+               # search similar broadcastings
                if event_id is None:
                        return
                l = self.epgcache.search(('RIBND', 1024, eEPGCache.SIMILAR_BROADCASTINGS_SEARCH, refstr, event_id))
@@ -349,3 +350,15 @@ class EPGList(HTMLComponent, GUIComponent):
                self.l.setList(l)
                self.selectionChanged()
                print time() - t
+
+       def applySkin(self, desktop, parent):
+               def setEventItemFont(value):
+                       self.eventItemFont = parseFont(value, ((1,1),(1,1)))
+               def setEventTimeFont(value):
+                       self.eventTimeFont = parseFont(value, ((1,1),(1,1)))
+               for (attrib, value) in [x for x in self.skinAttributes if x[0] in dir()]:
+                       eval(attrib + "('" + value + "')")
+                       self.skinAttributes.remove((attrib, value))
+               self.l.setFont(0, self.eventItemFont)
+               self.l.setFont(1, self.eventTimeFont)
+               return GUIComponent.applySkin(self, desktop, parent)
\ No newline at end of file