summaryrefslogtreecommitdiff
path: root/indra/newview/llfolderviewitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfolderviewitem.cpp')
-rw-r--r--indra/newview/llfolderviewitem.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index afad27b4e0..712d3e4583 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -40,6 +40,7 @@
#include "llviewerwindow.h" // Argh, only for setCursor()
// linden library includes
+#include "llclipboard.h"
#include "llfocusmgr.h" // gFocusMgr
#include "lltrans.h"
@@ -1002,7 +1003,7 @@ void LLFolderViewItem::draw()
LLColor4 color = (mIsSelected && filled) ? sHighlightFgColor : sFgColor;
if (highlight_link) color = sLinkColor;
if (in_library) color = sLibraryColor;
-
+
F32 right_x = 0;
F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD - (F32)TOP_PAD;
F32 text_left = (F32)(ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + mIndentation);
@@ -1158,7 +1159,36 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation)
mNeedsSort = false;
}
+ // evaluate mHasVisibleChildren
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 );