diff options
Diffstat (limited to 'indra/llui/llfolderviewitem.cpp')
-rw-r--r-- | indra/llui/llfolderviewitem.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index f4a6053b57..eba93beed9 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -961,9 +961,10 @@ void LLFolderViewItem::draw() // if (filter_string_length > 0) { - F32 match_string_left = text_left + font->getWidthF32(combined_string, 0, mViewModelItem->getFilterStringOffset()); + S32 filter_offset = mViewModelItem->getFilterStringOffset(); + F32 match_string_left = text_left + font->getWidthF32(combined_string, 0, filter_offset + filter_string_length) - font->getWidthF32(combined_string, filter_offset, filter_string_length); F32 yy = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad - (F32)TOP_PAD; - font->renderUTF8( combined_string, mViewModelItem->getFilterStringOffset(), match_string_left, yy, + font->renderUTF8( combined_string, filter_offset, match_string_left, yy, sFilterTextColor, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, filter_string_length, S32_MAX, &right_x, FALSE ); } @@ -1609,7 +1610,7 @@ void LLFolderViewFolder::destroyView() // extractItem() removes the specified item from the folder, but // doesn't delete it. -void LLFolderViewFolder::extractItem( LLFolderViewItem* item ) +void LLFolderViewFolder::extractItem( LLFolderViewItem* item, bool deparent_model ) { if (item->isSelected()) getRoot()->clearSelection(); @@ -1632,7 +1633,11 @@ void LLFolderViewFolder::extractItem( LLFolderViewItem* item ) mItems.erase(it); } //item has been removed, need to update filter - getViewModelItem()->removeChild(item->getViewModelItem()); + if (deparent_model) + { + // in some cases model does not belong to parent view, is shared between views + getViewModelItem()->removeChild(item->getViewModelItem()); + } //because an item is going away regardless of filter status, force rearrange requestArrange(); removeChild(item); |