aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-05-03 18:59:52 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-05-03 18:59:52 +0000
commita4bc78f89a0867d9dfdea23ac118f816981022bc (patch)
treee39b0fabeca3bc1c7c7899da127d70fb5827391f
parent5c30e18bc4e27a6814545d6dade5fc48884a7c0e (diff)
downloadenigma2-a4bc78f89a0867d9dfdea23ac118f816981022bc.tar.gz
enigma2-a4bc78f89a0867d9dfdea23ac118f816981022bc.zip
allow changing titlebar offset / font by skin
-rw-r--r--data/skin.xml1
-rw-r--r--skin.py18
2 files changed, 16 insertions, 3 deletions
diff --git a/data/skin.xml b/data/skin.xml
index 80e38d63..995c51a7 100644
--- a/data/skin.xml
+++ b/data/skin.xml
@@ -13,6 +13,7 @@
<color name="transpBlack" value="#80000000" />
</colors>
<windowstyle type="skinned">
+ <title offset="20,5" font="Regular;20" />
<color name="Background" color="#33294a6b" />
<color name="LabelForeground" color="#ffffff" />
<color name="ListboxBackground" color="#33294a6b" />
diff --git a/skin.py b/skin.py
index da97b88a..c16d998c 100644
--- a/skin.py
+++ b/skin.py
@@ -84,7 +84,7 @@ def applySingleAttribute(guiObject, desktop, attrib, value):
elif attrib == "pixmap":
ptr = loadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, value))
# that __deref__ still scares me!
- desktop.makeCompatiblePixmap(ptr.__deref__())
+# desktop.makeCompatiblePixmap(ptr.__deref__())
guiObject.setPixmap(ptr.__deref__())
# guiObject.setPixmapFromFile(value)
elif attrib == "alphatest": # used by ePixmap
@@ -131,6 +131,8 @@ def applySingleAttribute(guiObject, desktop, attrib, value):
guiObject.setBackgroundColor(parseColor(value))
elif attrib == "foregroundColor":
guiObject.setForegroundColor(parseColor(value))
+ elif attrib == "shadowColor":
+ guiObject.setShadowColor(parseColor(value))
elif attrib == "selectionDisabled":
guiObject.setSelectionEnable(0)
elif attrib == "transparent":
@@ -155,6 +157,8 @@ def applySingleAttribute(guiObject, desktop, attrib, value):
guiObject.setPointer(ptr.__deref__(), pos)
elif attrib != 'name':
print "unsupported attribute " + attrib + "=" + value
+ elif attrib == 'shadowOffset':
+ guiObject.setShadowOffset(parsePosition(value))
except int:
# AttributeError:
print "widget %s (%s) doesn't support attribute %s!" % ("", guiObject.__class__.__name__, attrib)
@@ -182,8 +186,16 @@ def loadSingleSkinData(desktop, dom_skin):
for windowstyle in elementsWithTag(skin.childNodes, "windowstyle"):
style = eWindowStyleSkinned()
- style.setTitleFont(gFont("Regular", 20));
- style.setTitleOffset(eSize(20, 5));
+ # defaults
+ font = gFont("Regular", 20)
+ offset = eSize(20, 5)
+
+ for title in elementsWithTag(windowstyle.childNodes, "title"):
+ offset = parseSize(title.getAttribute("offset"))
+ font = parseFont(str(title.getAttribute("font")))
+
+ style.setTitleFont(font);
+ style.setTitleOffset(offset)
for borderset in elementsWithTag(windowstyle.childNodes, "borderset"):
bsName = str(borderset.getAttribute("name"))