aboutsummaryrefslogtreecommitdiff
path: root/lib/gui/elistbox.cpp
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-04-21 10:59:26 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-04-21 10:59:26 +0000
commitf58e4c7b0aa0b7246b56e1956e23cf5b41dd6f9c (patch)
treed46e842c2526c7f68c5fd28de5806c583b0a721b /lib/gui/elistbox.cpp
parent13d05b593618882cfc356aef47a4a02fcb857271 (diff)
downloadenigma2-f58e4c7b0aa0b7246b56e1956e23cf5b41dd6f9c.tar.gz
enigma2-f58e4c7b0aa0b7246b56e1956e23cf5b41dd6f9c.zip
call (re)paint function just for needed entries
Diffstat (limited to 'lib/gui/elistbox.cpp')
-rw-r--r--lib/gui/elistbox.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/gui/elistbox.cpp b/lib/gui/elistbox.cpp
index 09d5ec2a..f3028ae3 100644
--- a/lib/gui/elistbox.cpp
+++ b/lib/gui/elistbox.cpp
@@ -310,10 +310,23 @@ int eListbox::event(int event, void *data, void *data2)
m_content->cursorSave();
m_content->cursorMove(m_top - m_selected);
+ gRegion entryrect = eRect(0, 0, size().width(), m_itemheight);
+ const gRegion &paint_region = *(gRegion*)data;
+
for (int y = 0, i = 0; i <= m_items_per_page; y += m_itemheight, ++i)
{
- m_content->paint(painter, *style, ePoint(0, y), m_selected == m_content->cursorGet() && m_content->size() && m_selection_enabled);
+ gRegion entry_clip_rect = paint_region & entryrect;
+
+ if (!entry_clip_rect.empty())
+ m_content->paint(painter, *style, ePoint(0, y), m_selected == m_content->cursorGet() && m_content->size() && m_selection_enabled);
+
+ /* (we could clip with entry_clip_rect, but
+ this shouldn't change the behaviour of any
+ well behaving content, so it would just
+ degrade performance without any gain.) */
+
m_content->cursorMove(+1);
+ entryrect.moveBy(ePoint(0, m_itemheight));
}
if (m_scrollbar && m_scrollbar->isVisible())