aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components
diff options
context:
space:
mode:
authoracid-burn <acidburn@opendreambox.org>2009-10-13 23:02:22 +0200
committeracid-burn <acidburn@opendreambox.org>2009-10-13 23:02:22 +0200
commit755936c5114029219a6800b81b74ffdfbcbbfe30 (patch)
treecf028d4350f2aab333634d2f67568234c1a7dfce /lib/python/Components
parentf8b2c3b18b2719f33a940576b408f66a54a7c223 (diff)
downloadenigma2-755936c5114029219a6800b81b74ffdfbcbbfe30.tar.gz
enigma2-755936c5114029219a6800b81b74ffdfbcbbfe30.zip
Components/GUISkin.py: - add possibility to access the Screen title from inside the skin without the need to declare it inside every Screen.
Just use self.setTitle(_("yourTitle)") inside your Screens onLayoutFinish to set the Title and access it from your skinfile over for example: <widget source="Title" render="Label" position="80,110" size="322,75" .....> if needed like inside fullscreen screens where no Border is drawn.
Diffstat (limited to 'lib/python/Components')
-rwxr-xr-x[-rw-r--r--]lib/python/Components/GUISkin.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/python/Components/GUISkin.py b/lib/python/Components/GUISkin.py
index 1bd27297..4ee8a4a3 100644..100755
--- a/lib/python/Components/GUISkin.py
+++ b/lib/python/Components/GUISkin.py
@@ -1,11 +1,13 @@
from GUIComponent import GUIComponent
from skin import applyAllAttributes
from Tools.CList import CList
+from Sources.StaticText import StaticText
class GUISkin:
__module__ = __name__
def __init__(self):
+ self["Title"] = StaticText()
self.onLayoutFinish = [ ]
self.summaries = CList()
self.instance = None
@@ -63,9 +65,14 @@ class GUISkin:
def setTitle(self, title):
self.instance.setTitle(title)
- self.title = title
+ self["Title"].text = title
self.summaries.setTitle(title)
+ def getTitle(self):
+ return self["Title"].text
+
+ title = property(getTitle, setTitle)
+
def setDesktop(self, desktop):
self.desktop = desktop
@@ -88,6 +95,6 @@ class GUISkin:
# we need to make sure that certain attributes come last
self.skinAttributes.sort(key=lambda a: {"position": 1}.get(a[0], 0))
- self.title = title
+ self["Title"].text = title
applyAllAttributes(self.instance, self.desktop, self.skinAttributes, self.scale)
self.createGUIScreen(self.instance, self.desktop)