git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix memleak when call of convertFunc failes
[enigma2.git]
/
lib
/
gui
/
elistboxcontent.cpp
diff --git
a/lib/gui/elistboxcontent.cpp
b/lib/gui/elistboxcontent.cpp
index 362a3f8410782aadc16f4578bc513e80fc620471..5959343a4033552e2f057b569d891c0090c3fadd 100644
(file)
--- 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)
{
void eListboxTestContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
{
- ePtr<gFont> fnt = new gFont("
Arial
", 20);
+ ePtr<gFont> fnt = new gFont("
Regular
", 20);
painter.clip(eRect(offset, m_size));
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
painter.clear();
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)
{
void eListboxStringContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
{
- ePtr<gFont> fnt = new gFont("
Arial
", 20);
+ ePtr<gFont> fnt = new gFont("
Regular
", 20);
painter.clip(eRect(offset, m_itemsize));
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
painter.clear();
painter.clip(eRect(offset, m_itemsize));
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
painter.clear();
@@
-246,6
+246,7
@@
void eListboxStringContent::setList(std::list<std::string> &list)
m_list = list;
m_size = list.size();
cursorHome();
m_list = list;
m_size = list.size();
cursorHome();
+ m_listbox->entryReset(false);
}
//////////////////////////////////////
}
//////////////////////////////////////
@@
-327,7
+328,7
@@
void eListboxPythonStringContent::setSize(const eSize &size)
void eListboxPythonStringContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
{
void eListboxPythonStringContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
{
- ePtr<gFont> fnt = new gFont("
Arial
", 20);
+ ePtr<gFont> fnt = new gFont("
Regular
", 20);
painter.clip(eRect(offset, m_itemsize));
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
painter.clear();
painter.clip(eRect(offset, m_itemsize));
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
painter.clear();
@@
-366,9
+367,8
@@
void eListboxPythonStringContent::setList(PyObject *list)
Py_INCREF(m_list);
}
Py_INCREF(m_list);
}
- //always invalidate when we get a new list
if (m_listbox)
if (m_listbox)
- m_listbox->
invalidate(
);
+ m_listbox->
entryReset(false
);
}
PyObject *eListboxPythonStringContent::getCurrentSelection()
}
PyObject *eListboxPythonStringContent::getCurrentSelection()
@@
-398,8
+398,8
@@
void eListboxPythonStringContent::invalidate()
void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
{
void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
{
- ePtr<gFont> fnt = new gFont("
Arial
", 20);
- ePtr<gFont> fnt2 = new gFont("
Arial
", 16);
+ ePtr<gFont> fnt = new gFont("
Regular
", 20);
+ ePtr<gFont> fnt2 = new gFont("
Regular
", 16);
painter.clip(eRect(offset, m_itemsize));
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
painter.clear();
painter.clip(eRect(offset, m_itemsize));
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
painter.clear();
@@
-545,7
+545,8
@@
RESULT SwigFromPython(ePtr<gPixmap> &res, PyObject *obj);
void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
{
void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
{
- painter.clip(eRect(offset, m_itemsize));
+ eRect itemrect(offset, m_itemsize);
+ painter.clip(itemrect);
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
painter.clear();
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
painter.clear();
@@
-661,16
+662,25
@@
void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
}
eRect r = eRect(x, y, width, height);
r.moveBy(offset);
}
eRect r = eRect(x, y, width, height);
r.moveBy(offset);
+ r &= itemrect;
painter.setFont(m_font[fnt]);
painter.setFont(m_font[fnt]);
+ painter.clip(r);
painter.renderText(r, string, flags);
painter.renderText(r, string, flags);
+ painter.clippop();
Py_XDECREF(pstring);
break;
}
case 1: // pixmap
{
Py_XDECREF(pstring);
break;
}
case 1: // pixmap
{
+ if (!(px && py && pwidth && pheight && pfnt))
+ {
+ eDebug("eListboxPythonMultiContent received too small tuple (must be (x, y, width, height, pixmap))");
+ painter.clippop();
+ return;
+ }
int x = PyInt_AsLong(px);
int y = PyInt_AsLong(py);
int width = PyInt_AsLong(pwidth);
int x = PyInt_AsLong(px);
int y = PyInt_AsLong(py);
int width = PyInt_AsLong(pwidth);
@@
-678,8
+688,12
@@
void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
eRect r = eRect(x, y, width, height);
r.moveBy(offset);
eRect r = eRect(x, y, width, height);
r.moveBy(offset);
+ r &= itemrect;
+ painter.clip(r);
painter.blit(pixmap, r.topLeft(), r);
painter.blit(pixmap, r.topLeft(), r);
+ painter.clippop();
+
break;
}
default:
break;
}
default: