X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/9f3ff2c642130e984c3df82fa6228da99b132f74..5c27251fa08566a00d124aaf2c02249995dac9cf:/lib/gui/elistboxcontent.cpp diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp index cc661d47..35618786 100644 --- a/lib/gui/elistboxcontent.cpp +++ b/lib/gui/elistboxcontent.cpp @@ -110,7 +110,7 @@ void eListboxTestContent::setSize(const eSize &size) void eListboxTestContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected) { - ePtr fnt = new gFont("Arial", 14); + ePtr fnt = new gFont("Arial", 20); painter.clip(eRect(offset, m_size)); style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal); painter.clear(); @@ -219,7 +219,7 @@ void eListboxStringContent::setSize(const eSize &size) void eListboxStringContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected) { - ePtr fnt = new gFont("Arial", 14); + ePtr fnt = new gFont("Arial", 20); painter.clip(eRect(offset, m_itemsize)); style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal); painter.clear(); @@ -365,6 +365,10 @@ void eListboxPythonStringContent::setList(PyObject *list) m_list = list; Py_INCREF(m_list); } + + //always invalidate when we get a new list + if (m_listbox) + m_listbox->invalidate(); } PyObject *eListboxPythonStringContent::getCurrentSelection() @@ -384,11 +388,17 @@ void eListboxPythonStringContent::invalidateEntry(int index) m_listbox->entryChanged(index); } +void eListboxPythonStringContent::invalidate() +{ + if (m_listbox) + m_listbox->invalidate(); +} + ////////////////////////////////////// void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected) { - ePtr fnt = new gFont("Arial", 14); + ePtr fnt = new gFont("Arial", 20); ePtr fnt2 = new gFont("Arial", 16); painter.clip(eRect(offset, m_itemsize)); style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal); @@ -428,13 +438,16 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, /* CallObject will call __call__ which should return the value tuple */ value = PyObject_CallObject(value, args); + + if (PyErr_Occurred()) + PyErr_Print(); Py_DECREF(args); /* the PyInt was stolen. */ } /* check if this is really a tuple */ - if (PyTuple_Check(value)) + if (value && PyTuple_Check(value)) { /* convert type to string */ PyObject *type = PyTuple_GetItem(value, 0); @@ -513,7 +526,8 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, } } Py_XDECREF(type); - } + } else + eWarning("eListboxPythonConfigContent: second value of tuple is not a tuple."); /* value is borrowed */ }