diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 2762c7af82ff1b8c537269d456689975e27e87cc..93269db3800efb4e36c9e33c82d729030e6f941a 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -563,6 +563,7 @@ void LLInventoryPanel::modelChanged(U32 mask) { setSelection(item_id, FALSE); } + updateFolderLabel(model_item->getParentUUID()); } ////////////////////////////// @@ -574,6 +575,7 @@ void LLInventoryPanel::modelChanged(U32 mask) // Don't process the item if it is the root if (old_parent) { + LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(old_parent->getViewModelItem()); LLFolderViewFolder* new_parent = (LLFolderViewFolder*)getItemByID(model_item->getParentUUID()); // Item has been moved. if (old_parent != new_parent) @@ -591,6 +593,7 @@ void LLInventoryPanel::modelChanged(U32 mask) setSelection(item_id, FALSE); } } + updateFolderLabel(model_item->getParentUUID()); } else { @@ -602,6 +605,10 @@ void LLInventoryPanel::modelChanged(U32 mask) // doesn't include trash). Just remove the item's UI. view_item->destroyView(); } + if(viewmodel_folder) + { + updateFolderLabel(viewmodel_folder->getUUID()); + } old_parent->getViewModelItem()->dirtyDescendantsFilter(); } } @@ -619,6 +626,11 @@ void LLInventoryPanel::modelChanged(U32 mask) if(parent) { parent->getViewModelItem()->dirtyDescendantsFilter(); + LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(parent->getViewModelItem()); + if(viewmodel_folder) + { + updateFolderLabel(viewmodel_folder->getUUID()); + } } } } @@ -1162,6 +1174,23 @@ void LLInventoryPanel::onSelectionChange(const std::deque<LLFolderViewItem*>& it } +void LLInventoryPanel::updateFolderLabel(const LLUUID& folder_id) +{ + if(folder_id != mPreviousSelectedFolder) return; + + LLFolderViewItem* folder_item = getItemByID(mPreviousSelectedFolder); + if(folder_item) + { + LLFolderBridge* bridge = (LLFolderBridge*)folder_item->getViewModelItem(); + if(bridge) + { + bridge->clearDisplayName(); + bridge->setShowDescendantsCount(true); + folder_item->refresh(); + } + } +} + void LLInventoryPanel::doCreate(const LLSD& userdata) { reset_inventory_filter(); diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 3829fb734d54abc8638b6587210f5cb09fe472bd..12001f5a2be5c16eece14e57fe6659d92137dc03 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -209,6 +209,8 @@ class LLInventoryPanel : public LLPanel bool attachObject(const LLSD& userdata); static void idle(void* user_data); + void updateFolderLabel(const LLUUID& folder_id); + // DEBUG ONLY: static void dumpSelectionInformation(void* user_data);