summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorygallery.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-07-21 17:19:04 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-07-21 17:33:37 +0300
commitd237b9ee1b0bbcdb3431f8afc873af4ee9e21a4e (patch)
tree863724dcc3e097fef56db717023fda92488b569c /indra/newview/llinventorygallery.cpp
parent0941fcd5a48e9d4d95fb88750db3b964aa983486 (diff)
SL-20040 Fix selection callback
Diffstat (limited to 'indra/newview/llinventorygallery.cpp')
-rw-r--r--indra/newview/llinventorygallery.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index 99bd772773..87dba5f100 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -1302,7 +1302,7 @@ void LLInventoryGallery::showContextMenu(LLUICtrl* ctrl, S32 x, S32 y, const LLU
if (std::find(mSelectedItemIDs.begin(), mSelectedItemIDs.end(), item_id) == mSelectedItemIDs.end())
{
mSelectedItemIDs.clear();
- mSelectedItemIDs.push_back(item_id);
+ changeItemSelection(item_id, false);
}
uuid_vec_t selected_uuids;
selected_uuids.push_back(item_id);
@@ -1318,8 +1318,10 @@ void LLInventoryGallery::changeItemSelection(const LLUUID& item_id, bool scroll_
mNeedsSelection = true;
return;
}
- if (std::find(mSelectedItemIDs.begin(), mSelectedItemIDs.end(), item_id) == mSelectedItemIDs.end())
+ if (mSelectedItemIDs.size() == 1
+ && std::find(mSelectedItemIDs.begin(), mSelectedItemIDs.end(), item_id) != mSelectedItemIDs.end())
{
+ // Already selected
return;
}
@@ -1330,6 +1332,7 @@ void LLInventoryGallery::changeItemSelection(const LLUUID& item_id, bool scroll_
mItemMap[id]->setSelected(FALSE);
}
}
+ mSelectedItemIDs.clear();
if (mItemMap[item_id])
{
@@ -2388,9 +2391,6 @@ BOOL LLInventoryGalleryItem::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
setFocus(TRUE);
mGallery->claimEditHandler();
-
- //S32 gal_x, gal_y;
- //localPointToOtherView(x, y, &gal_x, &gal_y, mGallery);
mGallery->showContextMenu(this, x, y, mUUID);
LLUICtrl::handleRightMouseDown(x, y, mask);