- add positioner plugin (just basic gui atm)
[enigma2.git] / lib / gui / elistboxcontent.cpp
index c874cd3616dffa29ee8a6e1368399e35912d3fdc..f5ae2b3837d3507d8b2239f4bd27e7fb42c8f4fa 100644 (file)
@@ -374,10 +374,11 @@ void eListboxPythonStringContent::setList(PyObject *list)
 
 PyObject *eListboxPythonStringContent::getCurrentSelection()
 {
-       if (!m_list)
-               return 0;
-       if (!cursorValid())
-               return 0;
+       if (!(m_list && cursorValid()))
+       {
+               Py_INCREF(Py_None);
+               return Py_None;
+       }
        PyObject *r = PyList_GET_ITEM(m_list, m_cursor);
        Py_XINCREF(r);
        return r;
@@ -475,12 +476,14 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style,
                                        } else if (!strcmp(atype, "slider"))
                                        {
                                                PyObject *pvalue = PyTuple_GET_ITEM(value, 1);
+                                               PyObject *psize = PyTuple_GET_ITEM(value, 2);
                                                
                                                        /* convert value to Long. fallback to -1 on error. */
                                                int value = (pvalue && PyInt_Check(pvalue)) ? PyInt_AsLong(pvalue) : -1;
+                                               int size = (pvalue && PyInt_Check(psize)) ? PyInt_AsLong(psize) : 100;
                                                
                                                        /* calc. slider length */
-                                               int width = item_right.width() * value / 100;
+                                               int width = item_right.width() * value / size;
                                                int height = item_right.height();
                                                
                                                                                                
@@ -517,7 +520,7 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style,
                                                        int num = PyInt_Check(entry) ? PyInt_AsLong(entry) : -1;
                                                        
                                                        if ((num < 0) || (num >= glyphs))
-                                                               eWarning("glyph index %d in PythonConfigList out of bounds!");
+                                                               eWarning("glyph index %d in PythonConfigList out of bounds!", num);
                                                        else
                                                        {
                                                                para->setGlyphFlag(num, GS_INVERT);
@@ -713,6 +716,7 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
 
                                break;
                        }
+                       case TYPE_PIXMAP_ALPHATEST:
                        case TYPE_PIXMAP: // pixmap
                        {
                                if (!(px && py && pwidth && pheight && pfnt))
@@ -736,7 +740,7 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
                                r &= itemrect;
                                
                                painter.clip(r);
-                               painter.blit(pixmap, r.topLeft(), r);
+                               painter.blit(pixmap, r.topLeft(), r, (type == TYPE_PIXMAP_ALPHATEST) ? gPainter::BT_ALPHATEST : 0);
                                painter.clippop();
 
                                break;