git.cweiske.de
/
enigma2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
28104e7
)
listbox: validate m_items_per_page a bit more
author
Felix Domke
<tmbinc@elitedvb.net>
Wed, 21 Dec 2005 02:51:16 +0000
(
02:51
+0000)
committer
Felix Domke
<tmbinc@elitedvb.net>
Wed, 21 Dec 2005 02:51:16 +0000
(
02:51
+0000)
lib/gui/elistbox.cpp
patch
|
blob
|
history
diff --git
a/lib/gui/elistbox.cpp
b/lib/gui/elistbox.cpp
index bfa09b88844a649a5147226c92b529b0fd5b5376..aba7443227d23a83598643ac21cc445f7fbe941c 100644
(file)
--- a/
lib/gui/elistbox.cpp
+++ b/
lib/gui/elistbox.cpp
@@
-15,6
+15,8
@@
eListbox::eListbox(eWidget *parent)
m_itemheight = 25;
m_selection_enabled = 1;
+ m_items_per_page = 0;
+
ptr->bindAction("ListboxActions", 0, 0, this);
}
@@
-281,6
+283,10
@@
void eListbox::recalcSize()
m_prev_scrollbar_page=-1;
m_content->setSize(eSize(size().width(), m_itemheight));
m_items_per_page = size().height() / m_itemheight;
+
+ if (m_items_per_page < 0) /* TODO: whyever - our size could be invalid, or itemheigh could be wrongly specified. */
+ m_items_per_page = 0;
+
moveSelection(justCheck);
}