- work on timers
[enigma2.git] / lib / gui / elistbox.cpp
index ba2e35226fc20077adbf1a43cea0f78726a48bdf..4598fa091e8a696291dba216d5b82cb428690401 100644 (file)
@@ -9,6 +9,8 @@ eListbox::eListbox(eWidget *parent): eWidget(parent)
        ePtr<eActionMap> ptr;
        eActionMap::getInstance(ptr);
        
+       m_itemheight = 20;
+       
        ptr->bindAction("ListboxActions", 0, 0, this);
 }
 
@@ -146,11 +148,19 @@ int eListbox::event(int event, void *data, void *data2)
 
 void eListbox::recalcSize()
 {
-       m_itemheight = 20;
        m_content->setSize(eSize(size().width(), m_itemheight));
        m_items_per_page = size().height() / m_itemheight;
 }
 
+void eListbox::setItemHeight(int h)
+{
+       if (h)
+               m_itemheight = h;
+       else
+               m_itemheight = 20;
+       recalcSize();
+}
+
 void eListbox::entryAdded(int index)
 {
                /* manage our local pointers. when the entry was added before the current position, we have to advance. */