diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-06-10 08:59:29 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-06-10 08:59:29 +0000 |
| commit | dd1bda8e5e82695ce0291ba7eac22481b9e5921d (patch) | |
| tree | 4aa05f89d431a3bc7ca4a74e518e495b0d908233 | |
| parent | 1efbb50d3ab02af155035404ffc107c275799f8d (diff) | |
| download | enigma2-dd1bda8e5e82695ce0291ba7eac22481b9e5921d.tar.gz enigma2-dd1bda8e5e82695ce0291ba7eac22481b9e5921d.zip | |
use first color in "foregroundColors" as "foregroundColor" when
"foregroundColor" is not defined!
use first color in "backgroundColors" as "backgroundColor" when
"backgroundColor" is not defined"
| -rw-r--r-- | lib/python/Components/Label.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/python/Components/Label.py b/lib/python/Components/Label.py index 5f74b75c..49e94e6e 100644 --- a/lib/python/Components/Label.py +++ b/lib/python/Components/Label.py @@ -46,20 +46,32 @@ class MultiColorLabel(Label): def applySkin(self, desktop, screen): if self.skinAttributes is not None: + foregroundColor = None + backgroundColor = None attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "foregroundColors": colors = value.split(',') - attribs.append(("foregroundColor",colors[0] )) for color in colors: self.foreColors.append(parseColor(color)) + if not foregroundColor: + foregroundColor = colors[0] elif attrib == "backgroundColors": colors = value.split(',') - attribs.append(("backgroundColor",colors[0] )) for color in colors: self.backColors.append(parseColor(color)) + if not backgroundColor: + backgroundColor = colors[0] + elif attrib == "backgroundColor": + backgroundColor = value + elif attrib == "foregroundColor": + foregroundColor = value else: attribs.append((attrib,value)) + if foregroundColor: + attribs.append(("foregroundColor",foregroundColor)) + if backgroundColor: + attribs.append(("backgroundColor",backgroundColor)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, screen) |
