summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-09-14 23:59:58 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-09-15 00:01:58 +0300
commit76c6dc025d39adba54cff2c112337274efaddd10 (patch)
treea0e5b3e09fcad5375fa437b5be43fd19eaf38205 /indra/newview
parent28e6ce451c3d01333a805f11286dacc9f3157c54 (diff)
SL-19826 Gallery multiselect support, fix right click
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorygallery.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index 1ee08eb01c..4838ba7a47 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -1012,20 +1012,16 @@ BOOL LLInventoryGallery::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
if (mSelectedItemIDs.size() > 0)
{
- selection_deque::iterator iter = mSelectedItemIDs.begin();
- if (mItemMap[*iter])
- {
- mItemMap[*iter]->setFocus(false);
- setFocus(true);
- }
+ setFocus(true);
}
- clearSelection();
+ mLastInteractedUUID = LLUUID::null;
// Scroll is going to always return true
BOOL res = LLPanel::handleRightMouseDown(x, y, mask);
- if (mSelectedItemIDs.empty())
+ if (mLastInteractedUUID.isNull()) // no child were hit
{
+ clearSelection();
if (mInventoryGalleryMenu && mFolderID.notNull())
{
uuid_vec_t selected_uuids;
@@ -1487,6 +1483,7 @@ void LLInventoryGallery::changeItemSelection(const LLUUID& item_id, bool scroll_
&& std::find(mSelectedItemIDs.begin(), mSelectedItemIDs.end(), item_id) != mSelectedItemIDs.end())
{
// Already selected
+ mLastInteractedUUID = item_id;
return;
}
@@ -1514,6 +1511,7 @@ void LLInventoryGallery::addItemSelection(const LLUUID& item_id, bool scroll_to_
if (std::find(mSelectedItemIDs.begin(), mSelectedItemIDs.end(), item_id) != mSelectedItemIDs.end())
{
// Already selected
+ mLastInteractedUUID = item_id;
return;
}
@@ -2707,7 +2705,7 @@ BOOL LLInventoryGalleryItem::handleMouseDown(S32 x, S32 y, MASK mask)
{
mGallery->toggleSelectionRangeFromLast(mUUID);
}
- else if (!isSelected())
+ else
{
mGallery->changeItemSelection(mUUID, false);
}
@@ -2724,6 +2722,15 @@ BOOL LLInventoryGalleryItem::handleMouseDown(S32 x, S32 y, MASK mask)
BOOL LLInventoryGalleryItem::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
+ if (!isSelected())
+ {
+ mGallery->changeItemSelection(mUUID, false);
+ }
+ else
+ {
+ // refresh last interacted
+ mGallery->addItemSelection(mUUID, false);
+ }
setFocus(TRUE);
mGallery->claimEditHandler();
mGallery->showContextMenu(this, x, y, mUUID);