summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorygallery.cpp
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-05-26 19:45:46 +0300
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-05-26 19:45:46 +0300
commit67e17bd822f146f333b91d353df6f55174ce4db6 (patch)
treea398e3bc373c0d2d8524786bf293aa2f6d5cc59f /indra/newview/llinventorygallery.cpp
parent572e8269bcd5320daa66f4074e927c79869bf7de (diff)
SL-19774 add context menu for root folder (without any selection); show paste menu when right clicking any item
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())