Skip to content
Snippets Groups Projects
Commit 76c6dc02 authored by Andrey Kleshchev's avatar Andrey Kleshchev
Browse files

SL-19826 Gallery multiselect support, fix right click

parent 28e6ce45
No related branches found
No related tags found
2 merge requests!3Update to main branch,!2Rebase onto current main branch
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment