trade Color and transparent skin attributes to parent widget and embedded
[enigma2.git] / lib / python / Components / ScrollLabel.py
index 85e176f635272ed9f6dcaf1163a9d38f18a7391b..fb89e4114b5da3d2446d54a31f19b8e247f33e36 100644 (file)
@@ -1,10 +1,11 @@
 import skin
-from HTMLComponent import *
-from GUIComponent import *
+from HTMLComponent import HTMLComponent
+from GUIComponent import GUIComponent
 from enigma import eLabel, eWidget, eSlider, fontRenderClass, ePoint, eSize
 
 class ScrollLabel(HTMLComponent, GUIComponent):
        def __init__(self, text=""):
+               GUIComponent.__init__(self)
                self.message = text
                self.instance = None
                self.long_text = None
@@ -13,7 +14,16 @@ class ScrollLabel(HTMLComponent, GUIComponent):
                self.total = None
 
        def applySkin(self, desktop):
-               skin.applyAllAttributes(self.long_text, desktop, self.skinAttributes)
+               ret = False
+               if self.skinAttributes is not None:
+                       skin.applyAllAttributes(self.long_text, desktop, self.skinAttributes)
+                       attribs = [ ]
+                       for (attrib, value) in self.skinAttributes:
+                               if attrib.find("Color") != -1 or attrib.find("transparent") != -1:
+                                       attribs.append((attrib,value))
+                       skin.applyAllAttributes(self.instance, desktop, attribs)
+                       skin.applyAllAttributes(self.scrollbar, desktop, attribs)
+                       ret = True
                s = self.long_text.size()
                self.instance.move(self.long_text.position())
                lineheight=fontRenderClass.getInstance().getLineHeight( self.long_text.getFont() )
@@ -28,10 +38,11 @@ class ScrollLabel(HTMLComponent, GUIComponent):
                self.long_text.move(ePoint(0,0))
                self.long_text.resize(eSize(s.width()-30, self.pageHeight*16))
                self.setText(self.message)
+               return ret
 
        def setText(self, text):
                self.message = text
-               if self.long_text is not None:
+               if self.long_text is not None and self.pageHeight:
                        self.long_text.move(ePoint(0,0))
                        self.long_text.setText(self.message)
                        text_height=self.long_text.calculateSize().height()