Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

select proper position in container with static content if items chan…

…ged visibility
  • Loading branch information...
commit ffdb63df1efeb781d4a67fe35cd8c3f39036242d 1 parent e863d58
@pieh pieh authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 xbmc/guilib/GUIBaseContainer.cpp
View
5 xbmc/guilib/GUIBaseContainer.cpp
@@ -830,6 +830,8 @@ void CGUIBaseContainer::UpdateVisibility(const CGUIListItem *item)
{ // update our item list with our new content, but only add those items that should
// be visible. Save the previous item and keep it if we are adding that one.
CGUIListItem *lastItem = m_lastItem;
+ unsigned int selected = GetSelectedItem();
+ CGUIListItem* selectedItem = m_items.size() > 0 ? m_items[selected].get() : NULL;
Reset();
bool updateItems = false;
if (!m_staticUpdateTime)
@@ -849,6 +851,9 @@ void CGUIBaseContainer::UpdateVisibility(const CGUIListItem *item)
m_items.push_back(item);
if (item.get() == lastItem)
m_lastItem = lastItem;
+ // if item is selected and it changed position, re-select it
+ if (item.get() == selectedItem && selected != i)
+ SelectItem(i);
}
// update any properties
if (updateItems)
Please sign in to comment.
Something went wrong with that request. Please try again.