Skip to content

Commit

Permalink
select proper position in container with static content if items chan…
Browse files Browse the repository at this point in the history
…ged visibility
  • Loading branch information
pieh committed Feb 15, 2012
1 parent e863d58 commit ffdb63d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xbmc/guilib/GUIBaseContainer.cpp
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit ffdb63d

Please sign in to comment.