summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorygallery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventorygallery.cpp')
-rw-r--r--indra/newview/llinventorygallery.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index 18a7068b66..c6fee42297 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -126,12 +126,15 @@ BOOL LLInventoryGallery::postBuild()
mGalleryPanel = LLUICtrlFactory::create<LLPanel>(params);
mMessageTextBox = getChild<LLTextBox>("empty_txt");
mInventoryGalleryMenu = new LLInventoryGalleryContextMenu(this);
+ mRootGalleryMenu = new LLInventoryGalleryContextMenu(this);
+ mRootGalleryMenu->setRootFolder(true);
return TRUE;
}
LLInventoryGallery::~LLInventoryGallery()
{
delete mInventoryGalleryMenu;
+ delete mRootGalleryMenu;
delete mFilter;
while (!mUnusedRowPanels.empty())
@@ -837,6 +840,27 @@ void LLInventoryGallery::onThumbnailAdded(LLUUID item_id)
}
}
+BOOL LLInventoryGallery::handleRightMouseDown(S32 x, S32 y, MASK mask)
+{
+ if(mItemMap[mSelectedItemID])
+ {
+ mItemMap[mSelectedItemID]->setFocus(false);
+ }
+ clearSelection();
+ BOOL res = LLPanel::handleRightMouseDown(x, y, mask);
+ if (mSelectedItemID.isNull())
+ {
+ if (mInventoryGalleryMenu && mFolderID.notNull())
+ {
+ uuid_vec_t selected_uuids;
+ selected_uuids.push_back(mFolderID);
+ mRootGalleryMenu->show(this, selected_uuids, x, y);
+ return TRUE;
+ }
+ }
+ return res;
+}
+
void LLInventoryGallery::showContextMenu(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& item_id)
{
if (mInventoryGalleryMenu && item_id.notNull())