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:
1c4c06d
)
listbox: move checkScrollbar to the proper place
author
Felix Domke
<tmbinc@elitedvb.net>
Mon, 12 Dec 2005 22:03:13 +0000
(22:03 +0000)
committer
Felix Domke
<tmbinc@elitedvb.net>
Mon, 12 Dec 2005 22:03:13 +0000
(22:03 +0000)
lib/gui/elistbox.cpp
patch
|
blob
|
history
diff --git
a/lib/gui/elistbox.cpp
b/lib/gui/elistbox.cpp
index c4f9ed2c2162277e879250421a9ffe0c4320c897..36310aefd5c5fe4e5f32a10f419542a8633d57ef 100644
(file)
--- a/
lib/gui/elistbox.cpp
+++ b/
lib/gui/elistbox.cpp
@@
-56,6
+56,10
@@
void eListbox::moveSelection(int dir)
/* refuse to do anything without a valid list. */
if (!m_content)
return;
/* refuse to do anything without a valid list. */
if (!m_content)
return;
+
+ /* if our list does not have one entry, don't do anything. */
+ if (!m_items_per_page)
+ return;
/* we need the old top/sel to see what we have to redraw */
int oldtop = m_top;
/* we need the old top/sel to see what we have to redraw */
int oldtop = m_top;
@@
-120,13
+124,18
@@
void eListbox::moveSelection(int dir)
while (m_selected < m_top)
{
while (m_selected < m_top)
{
+ eDebug("%d < %d", m_selected, m_top);
m_top -= m_items_per_page;
if (m_top < 0)
m_top = 0;
}
m_top -= m_items_per_page;
if (m_top < 0)
m_top = 0;
}
+
while (m_selected >= m_top + m_items_per_page)
while (m_selected >= m_top + m_items_per_page)
+ {
+ eDebug("%d >= %d + %d", m_selected, m_top, m_items_per_page);
/* m_top should be always valid here as it's selected */
m_top += m_items_per_page;
/* m_top should be always valid here as it's selected */
m_top += m_items_per_page;
+ }
if (m_top != oldtop)
invalidate();
if (m_top != oldtop)
invalidate();
@@
-139,6
+148,9
@@
void eListbox::moveSelection(int dir)
invalidate(inv);
}
invalidate(inv);
}
+
+ if (m_scrollbar_mode != showNever)
+ updateScrollBar();
}
void eListbox::moveSelectionTo(int index)
}
void eListbox::moveSelectionTo(int index)
@@
-213,9
+225,6
@@
int eListbox::event(int event, void *data, void *data2)
gPainter &painter = *(gPainter*)data2;
gPainter &painter = *(gPainter*)data2;
- if (m_scrollbar_mode != showNever)
- updateScrollBar();
-
m_content->cursorSave();
m_content->cursorMove(m_top - m_selected);
m_content->cursorSave();
m_content->cursorMove(m_top - m_selected);
@@
-329,5
+338,6
@@
void eListbox::entryReset()
m_content->cursorHome();
m_top = 0;
m_selected = 0;
m_content->cursorHome();
m_top = 0;
m_selected = 0;
+ moveSelection(justCheck);
invalidate();
}
invalidate();
}