aboutsummaryrefslogtreecommitdiff
path: root/lib/gui/elistbox.cpp
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-02-27 20:30:42 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-02-27 20:30:42 +0000
commit8d1f62f6525ccfdbcb83c64f701dbbc325c37dbd (patch)
tree20aaf0712f1f11f4ad7e13c45fd2834b72569fb6 /lib/gui/elistbox.cpp
parentccf6be8713d5ce64ef167ec9516899cd560e0c44 (diff)
downloadenigma2-8d1f62f6525ccfdbcb83c64f701dbbc325c37dbd.tar.gz
enigma2-8d1f62f6525ccfdbcb83c64f701dbbc325c37dbd.zip
remove test cruft, add possibility for a seperator
Diffstat (limited to 'lib/gui/elistbox.cpp')
-rw-r--r--lib/gui/elistbox.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/gui/elistbox.cpp b/lib/gui/elistbox.cpp
index d9f95c4b..747733d3 100644
--- a/lib/gui/elistbox.cpp
+++ b/lib/gui/elistbox.cpp
@@ -157,6 +157,53 @@ void eListbox::moveSelection(int dir)
break;
}
+ if (m_content->cursorValid() && !m_content->currentCursorSelectable())
+ {
+ eDebug("position not selectable");
+ /* ok, our cursor position is valid (i.e. in list), but not selectable. */
+
+ /* when moving up, continue until we found a valid position. */
+ if ((dir == moveUp) || (dir == pageDown))
+ {
+ eDebug("moving up");
+ while (m_content->cursorGet())
+ {
+ eDebug("tick");
+ m_content->cursorMove(-1);
+ if (m_content->currentCursorSelectable())
+ {
+ eDebug("now ok");
+ break;
+ }
+ }
+ } else
+ {
+ eDebug("moving down");
+ while (m_content->cursorValid())
+ {
+ eDebug("TICK");
+ m_content->cursorMove(+1);
+ if (m_content->currentCursorSelectable())
+ {
+ eDebug("NOW ok");
+ break;
+ }
+ }
+
+ if (!m_content->cursorValid())
+ {
+ eDebug("not valid (i.e.: end)");
+ m_content->cursorMove(-1);
+ }
+ }
+
+ if (!m_content->currentCursorSelectable())
+ {
+ eDebug("can't move!");
+ m_content->cursorSet(oldsel);
+ }
+ }
+
/* note that we could be on an invalid cursor position, but we don't
care. this only happens on empty lists, and should have almost no
side effects. */