aboutsummaryrefslogtreecommitdiff
path: root/lib/gui/elistboxcontent.cpp
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2005-12-28 22:40:36 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2005-12-28 22:40:36 +0000
commitf228cfc8343e089176d885102558825bdb6a3d9c (patch)
tree76fe8056b1b7ae2b4391dc089eb892fd4a2984f1 /lib/gui/elistboxcontent.cpp
parent2bc75c09718546fe48ffe1e68c65402ec5fdf0f2 (diff)
downloadenigma2-f228cfc8343e089176d885102558825bdb6a3d9c.tar.gz
enigma2-f228cfc8343e089176d885102558825bdb6a3d9c.zip
clip each single region in listbox multicontent
Diffstat (limited to 'lib/gui/elistboxcontent.cpp')
-rw-r--r--lib/gui/elistboxcontent.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp
index 6e49dcb5..5959343a 100644
--- a/lib/gui/elistboxcontent.cpp
+++ b/lib/gui/elistboxcontent.cpp
@@ -545,7 +545,8 @@ RESULT SwigFromPython(ePtr<gPixmap> &res, PyObject *obj);
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();
@@ -661,16 +662,25 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
}
eRect r = eRect(x, y, width, height);
r.moveBy(offset);
+ r &= itemrect;
painter.setFont(m_font[fnt]);
+ painter.clip(r);
painter.renderText(r, string, flags);
+ painter.clippop();
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);
@@ -678,8 +688,12 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
eRect r = eRect(x, y, width, height);
r.moveBy(offset);
+ r &= itemrect;
+ painter.clip(r);
painter.blit(pixmap, r.topLeft(), r);
+ painter.clippop();
+
break;
}
default: