move cursor to valid position when current is invalid (on call invalidate)
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 17 Apr 2006 15:03:35 +0000 (15:03 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 17 Apr 2006 15:03:35 +0000 (15:03 +0000)
lib/gui/elistboxcontent.cpp

index afffbbe..261c548 100644 (file)
@@ -214,7 +214,12 @@ void eListboxPythonStringContent::invalidateEntry(int index)
 void eListboxPythonStringContent::invalidate()
 {
        if (m_listbox)
+       {
+               int s = size();
+               if ( m_cursor >= s )
+                       m_listbox->moveSelectionTo(s?s-1:0);
                m_listbox->invalidate();
+       }
 }
 
 //////////////////////////////////////