summaryrefslogtreecommitdiff
path: root/indra/newview/llsearchableui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llsearchableui.cpp')
-rw-r--r--indra/newview/llsearchableui.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/indra/newview/llsearchableui.cpp b/indra/newview/llsearchableui.cpp
index de90896548..93143eb33f 100644
--- a/indra/newview/llsearchableui.cpp
+++ b/indra/newview/llsearchableui.cpp
@@ -125,17 +125,13 @@ void ll::statusbar::SearchableItem::setNotHighlighted( )
}
}
-bool ll::statusbar::SearchableItem::hightlightAndHide( LLWString const &aFilter )
+bool ll::statusbar::SearchableItem::hightlightAndHide(LLWString const &aFilter, bool hide)
{
- if( mMenu && !mMenu->getVisible() && !mWasHiddenBySearch )
+ if ((mMenu && !mMenu->getVisible() && !mWasHiddenBySearch) || dynamic_cast<LLMenuItemTearOffGL*>(mMenu))
return false;
setNotHighlighted( );
- bool bVisible(false);
- for( tSearchableItemList::iterator itr = mChildren.begin(); itr != mChildren.end(); ++itr )
- bVisible |= (*itr)->hightlightAndHide( aFilter );
-
if( aFilter.empty() )
{
if( mCtrl )
@@ -143,17 +139,22 @@ bool ll::statusbar::SearchableItem::hightlightAndHide( LLWString const &aFilter
return true;
}
+ bool bHighlighted(!hide);
if( mLabel.find( aFilter ) != LLWString::npos )
{
if( mCtrl )
mCtrl->setHighlighted( true );
- return true;
+ bHighlighted = true;
}
- if( mCtrl && !bVisible )
+ bool bVisible(false);
+ for (tSearchableItemList::iterator itr = mChildren.begin(); itr != mChildren.end(); ++itr)
+ bVisible |= (*itr)->hightlightAndHide(aFilter, !bHighlighted);
+
+ if (mCtrl && !bVisible && !bHighlighted)
{
mWasHiddenBySearch = true;
mMenu->setVisible(FALSE);
}
- return bVisible;
+ return bVisible || bHighlighted;
}