fix handy like jumping in sorted service list
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Wed, 30 Nov 2005 16:08:15 +0000 (16:08 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Wed, 30 Nov 2005 16:08:15 +0000 (16:08 +0000)
lib/gui/elistbox.cpp

index ff5e269..e2f1c26 100644 (file)
@@ -96,17 +96,16 @@ void eListbox::moveSelection(int dir)
        
                /* now, look wether the current selection is out of screen */
        m_selected = m_content->cursorGet();
-       
-       if (m_selected < m_top)
+
+       while (m_selected < m_top)
        {
                m_top -= m_items_per_page;
                if (m_top < 0)
                        m_top = 0;
-       } else if (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;
        }
+       while (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;
 
        if (m_top != oldtop)
                invalidate();