X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/15a8fe81499c156e251986f5bd33801f54c140e9..3b29e9279367292962046494cf0da1b24827c269:/lib/gui/elistboxcontent.cpp diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp index 3c9457e1..1d0323cf 100644 --- a/lib/gui/elistboxcontent.cpp +++ b/lib/gui/elistboxcontent.cpp @@ -49,7 +49,8 @@ int iListboxContent::currentCursorSelectable() DEFINE_REF(eListboxPythonStringContent); -eListboxPythonStringContent::eListboxPythonStringContent(): m_itemheight(25) +eListboxPythonStringContent::eListboxPythonStringContent() + :m_cursor(0), m_itemheight(25) { } @@ -342,7 +343,6 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, if (PyTuple_Check(item)) { /* handle left part. get item from tuple, convert to string, display. */ - text = PyTuple_GET_ITEM(item, 0); text = PyObject_Str(text); /* creates a new object - old object was borrowed! */ const char *string = (text && PyString_Check(text)) ? PyString_AsString(text) : ""; @@ -356,7 +356,9 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, int value_alignment_left = !*string; /* now, handle the value. get 2nd part from tuple*/ - value = PyTuple_GET_ITEM(item, 1); + if (PyTuple_Size(item) >= 2) // when no 2nd entry is in tuple this is a non selectable entry without config part + value = PyTuple_GET_ITEM(item, 1); + if (value) { ePyObject args = PyTuple_New(1); @@ -467,7 +469,7 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, } } /* type is borrowed */ - } else + } else if (value) eWarning("eListboxPythonConfigContent: second value of tuple is not a tuple."); if (value) Py_DECREF(value); @@ -945,6 +947,7 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c break; } + case TYPE_PIXMAP_ALPHABLEND: case TYPE_PIXMAP_ALPHATEST: case TYPE_PIXMAP: // pixmap { @@ -997,7 +1000,7 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c clearRegion(painter, style, local_style, ePyObject(), ePyObject(), pbackColor, pbackColorSelected, selected, rc, sel_clip, offset, cursorValid); } - painter.blit(pixmap, rect.topLeft(), rect, (type == TYPE_PIXMAP_ALPHATEST) ? gPainter::BT_ALPHATEST : 0); + painter.blit(pixmap, rect.topLeft(), rect, (type == TYPE_PIXMAP_ALPHATEST) ? gPainter::BT_ALPHATEST : (type == TYPE_PIXMAP_ALPHABLEND) ? gPainter::BT_ALPHABLEND : 0); painter.clippop(); break; }