add EntryForegroundColor, EntryBorderColor, EntryBackgroundColor and
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 25 Sep 2007 21:44:51 +0000 (21:44 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 25 Sep 2007 21:44:51 +0000 (21:44 +0000)
EntryBackgroundColorSelected attributes to GraphMultiEPG EPGList..
instead of use queryColor...
remove unneeded queryColor function

lib/python/Plugins/Extensions/GraphMultiEPG/GraphMultiEpg.py
skin.py

index 648d4f1135c0f9e1496e8b43a5acf3dcbe0e72ab..594aea4b127812ac44b1ab07260035832187c14d 100644 (file)
@@ -1,4 +1,4 @@
-from skin import queryColor
+from skin import parseColor
 from Components.config import config, ConfigClock, ConfigInteger
 from Components.Pixmap import Pixmap
 from Components.Button import Button
@@ -43,24 +43,26 @@ class EPGList(HTMLComponent, GUIComponent):
                self.list = None
                self.event_rect = None
 
-               #query skin colors
-               col = queryColor("GraphEpg.Foreground")
-               self.foreColor = col and col.argb()
-
-               col = queryColor("GraphEpg.Border")
-               self.borderColor = col and col.argb()
-
-               col = queryColor("GraphEpg.Background")
-               if col is None:
-                       self.backColor = 0x586d88
-               else:
-                       self.backColor = col.argb()
-
-               col = queryColor("GraphEpg.BackgroundSelected")
-               if col is None:
-                       self.backColorSelected = 0x808080
-               else:
-                       self.backColorSelected = col.argb()
+               self.foreColor = None
+               self.borderColor = None
+               self.backColor = 0x586d88
+               self.backColorSelected = 0x808080
+
+       def applySkin(self, desktop):
+               attribs = [ ]
+               for (attrib, value) in self.skinAttributes:
+                       if attrib == "EntryForegroundColor":
+                               self.foreColor = parseColor(value).argb()
+                       elif attrib == "EntryBorderColor":
+                               self.borderColor = parseColor(value).argb()
+                       elif attrib == "EntryBackgroundColor":
+                               self.backColor = parseColor(value).argb()
+                       elif attrib == "EntryBackgroundColorSelected":
+                               self.backColorSelected = parseColor(value).argb()
+                       else:
+                               attribs.append((attrib,value))
+               self.skinAttributes = attribs
+               return GUIComponent.applySkin(self, desktop)
 
        def isSelectable(self, service, sname, event_list):
                return (event_list and len(event_list) and True) or False
diff --git a/skin.py b/skin.py
index b0b450559e629270ce91bc58407f9d3b8b0dc1da..fc0360c54888a09f1a7713856c5a8c0208d38a91 100644 (file)
--- a/skin.py
+++ b/skin.py
@@ -14,9 +14,6 @@ from Tools.XMLTools import elementsWithTag, mergeText
 
 colorNames = dict()
 
-def queryColor(colorName):
-       return colorNames.get(colorName)
-
 def dump(x, i=0):
        print " " * i + str(x)
        try: