diff options
Diffstat (limited to 'indra/newview/llinventorygallery.cpp')
-rw-r--r-- | indra/newview/llinventorygallery.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index 08836555d4..bfca22ba8a 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -27,8 +27,8 @@ #include "llviewerprecompiledheaders.h" #include "llinventorygallery.h" +#include "llinventorygallerymenu.h" -#include "llaccordionctrltab.h" #include "llcommonutils.h" #include "lliconctrl.h" #include "llinventorybridge.h" @@ -115,12 +115,14 @@ BOOL LLInventoryGallery::postBuild() LLPanel::Params params = LLPanel::getDefaultParams(); mGalleryPanel = LLUICtrlFactory::create<LLPanel>(params); mMessageTextBox = getChild<LLTextBox>("empty_txt"); - + mInventoryGalleryMenu = new LLInventoryGalleryContextMenu(this); return TRUE; } LLInventoryGallery::~LLInventoryGallery() { + delete mInventoryGalleryMenu; + while (!mUnusedRowPanels.empty()) { LLPanel* panelp = mUnusedRowPanels.back(); @@ -600,7 +602,7 @@ void LLInventoryGallery::updateAddedItem(LLUUID item_id) LLInventoryGalleryItem* item = buildGalleryItem(name, item_id, obj->getType(), thumbnail_id, obj->getIsLinkType()); mItemMap.insert(LLInventoryGallery::gallery_item_map_t::value_type(item_id, item)); - + item->setRightMouseDownCallback(boost::bind(&LLInventoryGallery::showContextMenu, this, _1, _2, _3, item_id)); item->setFocusReceivedCallback(boost::bind(&LLInventoryGallery::onChangeItemSelection, this, item_id)); if (mGalleryCreated) { @@ -671,6 +673,16 @@ void LLInventoryGallery::updateItemThumbnail(LLUUID item_id) } } +void LLInventoryGallery::showContextMenu(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& item_id) +{ + if (mInventoryGalleryMenu && item_id.notNull()) + { + uuid_vec_t selected_uuids; + selected_uuids.push_back(item_id); + mInventoryGalleryMenu->show(ctrl, selected_uuids, x, y); + } +} + void LLInventoryGallery::onChangeItemSelection(const LLUUID& category_id) { if (mSelectedItemID == category_id) |