[VMM] Sync with upstream for setting mHasVisibleChildren

This commit is contained in:
Lirusaito
2019-03-09 17:51:38 -05:00
parent 98ee2cbd7e
commit a94ad1c1fa

View File

@@ -1191,6 +1191,36 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation)
}
mHasVisibleChildren = hasFilteredDescendants(filter_generation);
if (mHasVisibleChildren)
{
// We have to verify that there's at least one child that's not filtered out
bool found = false;
// Try the items first
for (items_t::iterator iit = mItems.begin(); iit != mItems.end(); ++iit)
{
LLFolderViewItem* itemp = (*iit);
found = itemp->getFiltered(filter_generation);
if (found)
break;
}
if (!found)
{
// If no item found, try the folders
for (folders_t::iterator fit = mFolders.begin(); fit != mFolders.end(); ++fit)
{
LLFolderViewFolder* folderp = (*fit);
found = folderp->getListener()
&& (folderp->getFiltered(filter_generation)
|| (folderp->getFilteredFolder(filter_generation)
&& folderp->hasFilteredDescendants(filter_generation)));
if (found)
break;
}
}
mHasVisibleChildren = found;
}
// calculate height as a single item (without any children), and reshapes rectangle to match
LLFolderViewItem::arrange( width, height, filter_generation );