X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/48158ec0bbc8e623febb4d04a54e2e435daf865e..7bc4a59528ab13f3062dc1520e76f9ecedd87400:/lib/gui/elistbox.cpp?ds=sidebyside diff --git a/lib/gui/elistbox.cpp b/lib/gui/elistbox.cpp index ba2e3522..4598fa09 100644 --- a/lib/gui/elistbox.cpp +++ b/lib/gui/elistbox.cpp @@ -9,6 +9,8 @@ eListbox::eListbox(eWidget *parent): eWidget(parent) ePtr 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. */