diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-03-22 01:20:22 +0200 |
---|---|---|
committer | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-03-22 01:22:45 +0200 |
commit | d6a11416ec524420b6a6ac298b7b093cb24e9ec9 (patch) | |
tree | 019584dcbe14a39ab3022b3bdf4be4e6137f6dc1 /indra/newview | |
parent | 24f8f47d46b9f04d2c14571fd83e1f683296ff2f (diff) |
SL-19379 WIP handle updated thumbnails in Gallery mode
Diffstat (limited to 'indra/newview')
4 files changed, 34 insertions, 4 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index b5fd3aaece..132f294729 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -576,6 +576,14 @@ void LLInventoryGallery::updateAddedItem(LLUUID item_id) { addToGallery(item); } + + if (mCategoriesObserver == NULL) + { + mCategoriesObserver = new LLInventoryCategoriesObserver(); + gInventory.addObserver(mCategoriesObserver); + } + mCategoriesObserver->addCategory(item_id, + boost::bind(&LLInventoryGallery::updateItemThumbnail, this, item_id), true); } void LLInventoryGallery::updateRemovedItem(LLUUID item_id) @@ -583,6 +591,8 @@ void LLInventoryGallery::updateRemovedItem(LLUUID item_id) gallery_item_map_t::iterator item_iter = mItemMap.find(item_id); if (item_iter != mItemMap.end()) { + mCategoriesObserver->removeCategory(item_id); + LLInventoryGalleryItem* item = item_iter->second; deselectItem(item_id); @@ -611,6 +621,26 @@ void LLInventoryGallery::updateChangedItemName(LLUUID item_id, std::string name) } } +void LLInventoryGallery::updateItemThumbnail(LLUUID item_id) +{ + LLInventoryObject* obj = gInventory.getObject(item_id); + if (!obj) + { + return; + } + LLUUID thumbnail_id = obj->getThumbnailUUID(); + + if ((LLAssetType::AT_CATEGORY == obj->getType()) && thumbnail_id.isNull()) + { + thumbnail_id = getOutfitImageID(item_id); + } + + if (mItemMap[item_id]) + { + mItemMap[item_id]->setThumbnail(thumbnail_id); + } +} + void LLInventoryGallery::onChangeItemSelection(const LLUUID& category_id) { if (mSelectedItemID == category_id) diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h index ab9d27e260..35186c53fb 100644 --- a/indra/newview/llinventorygallery.h +++ b/indra/newview/llinventorygallery.h @@ -74,6 +74,7 @@ public: void updateAddedItem(LLUUID item_id); void updateRemovedItem(LLUUID item_id); void updateChangedItemName(LLUUID item_id, std::string name); + void updateItemThumbnail(LLUUID item_id); void updateMessageVisibility(); diff --git a/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml b/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml index 80beb2ec8a..c180024aa7 100644 --- a/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml +++ b/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml @@ -25,11 +25,11 @@ left="1"/> <icon left="5" - top_pad="-25" + top_pad="-21" layout="topleft" name="item_type" - height="20" - width="20" + height="16" + width="16" follows="left|top" visible="true" image_name="Inv_Eye"/> diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml index 3cdb3c5003..d670161e00 100644 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml @@ -327,6 +327,5 @@ background_visible="true" follows="all" layout="topleft" /> - </panel> </panel> </panel> |