Adapted SelectionList to fully skineable
authorims <ims21@users.sourceforge.net>
Fri, 16 Jan 2015 15:51:10 +0000 (16:51 +0100)
committerlittlesat <littlesat99@yahoo.com>
Fri, 16 Jan 2015 16:37:55 +0000 (17:37 +0100)
Signed-off-by: littlesat <littlesat99@yahoo.com>

lib/python/Components/SelectionList.py

index 1691ad4..5097dd8 100644 (file)
@@ -2,23 +2,27 @@ from MenuList import MenuList
 from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN
 from enigma import eListboxPythonMultiContent, eListbox, gFont, RT_HALIGN_LEFT
 from Tools.LoadPixmap import LoadPixmap
+import skin
 
 selectionpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/lock_on.png"))
 
 def SelectionEntryComponent(description, value, index, selected):
+       dx, dy, dw, dh = skin.parameters.get("SelectionListDescr",(25, 3, 650, 30))
        res = [
                (description, value, index, selected),
-               (eListboxPythonMultiContent.TYPE_TEXT, 25, 3, 650, 30, 0, RT_HALIGN_LEFT, description)
+               (eListboxPythonMultiContent.TYPE_TEXT, dx, dy, dw, dh, 0, RT_HALIGN_LEFT, description)
        ]
        if selected:
-               res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 0, 2, 25, 24, selectionpng))
+               ix, iy, iw, ih = skin.parameters.get("SelectionListLock",(0, 2, 25, 24))
+               res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, ix, iy, iw, ih, selectionpng))
        return res
 
 class SelectionList(MenuList):
        def __init__(self, list = None, enableWrapAround = False):
                MenuList.__init__(self, list or [], enableWrapAround, content = eListboxPythonMultiContent)
-               self.l.setFont(0, gFont("Regular", 20))
-               self.l.setItemHeight(30)
+               font = skin.fonts.get("SelectionList", ("Regular", 20, 30))
+               self.l.setFont(0, gFont(font[0], font[1]))
+               self.l.setItemHeight(font[2])
 
        def addSelection(self, description, value, index, selected = True):
                self.list.append(SelectionEntryComponent(description, value, index, selected))