add possibility to select between different list styles via context menu
[enigma2.git] / lib / gui / elistbox.cpp
index 65b24503071eb1370e4d695f75a5dba49d65ad0b..c21f363f4b9dd6a13b499e30687adfbeb63c77d9 100644 (file)
@@ -58,6 +58,9 @@ void eListbox::setContent(iListboxContent *content)
        if (content)
                m_content->setListbox(this);
        entryReset();
+                       /* if oldsel != m_selected, selectionChanged was already 
+                          emitted in entryReset. we want it in any case, so otherwise,
+                          emit it now. */
        if (oldsel == m_selected)
                /* emit */ selectionChanged();
 }
@@ -394,7 +397,9 @@ void eListbox::setSelectionEnable(int en)
 
 void eListbox::entryAdded(int index)
 {
-               /* manage our local pointers. when the entry was added before the current position, we have to advance. */
+       if (m_content && (m_content->size() % m_items_per_page) == 1)
+               m_content_changed=true;
+       /* manage our local pointers. when the entry was added before the current position, we have to advance. */
                
                /* we need to check <= - when the new entry has the (old) index of the cursor, the cursor was just moved down. */
        if (index <= m_selected)
@@ -416,7 +421,10 @@ void eListbox::entryAdded(int index)
 
 void eListbox::entryRemoved(int index)
 {
-        if (index == m_selected && m_content)
+       if (m_content && !(m_content->size() % m_items_per_page))
+               m_content_changed=true;
+
+       if (index == m_selected && m_content)
                m_selected = m_content->cursorGet();
 
        moveSelection(justCheck);