summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-06-12 16:10:28 +0300
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-06-12 16:10:28 +0300
commit929f9d8d5f2e7895016648557fa60c9d4a84baf6 (patch)
treec56628f2b391f7a313613f60dcfaf60915e31039 /indra
parent14aa4dcdc23feafc537f06e49c48e9d693300103 (diff)
SL-19825 clear selection when right-clicking outside of selected items
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llfolderview.cpp10
-rw-r--r--indra/newview/llavataractions.cpp25
-rw-r--r--indra/newview/llinventorypanel.cpp10
3 files changed, 32 insertions, 13 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 8660048058..7e5a9efb37 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -1471,6 +1471,16 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
mCallbackRegistrar->popScope();
}
}
+
+ bool item_clicked = false;
+ for (selected_items_t::iterator item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it)
+ {
+ item_clicked |= (*item_it)->getRect().pointInRect(x, y);
+ }
+ if(!item_clicked && mSingleFolderMode)
+ {
+ clearSelection();
+ }
bool hide_folder_menu = mSuppressFolderMenu && isFolderSelected();
if (menu && (mSingleFolderMode || (handled
&& ( count > 0 && (hasVisibleChildren()) ))) && // show menu only if selected items are visible
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 6bd2b8bbee..313339f131 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -765,8 +765,18 @@ namespace action_give_inventory
static bool is_give_inventory_acceptable(LLInventoryPanel* panel = NULL)
{
// check selection in the panel
- const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(panel);
- if (inventory_selected_uuids.empty()) return false; // nothing selected
+ std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(panel);
+ if (inventory_selected_uuids.empty())
+ {
+ if(panel && panel->getRootFolder() && panel->getRootFolder()->isSingleFolderMode())
+ {
+ inventory_selected_uuids.insert(panel->getRootFolderID());
+ }
+ else
+ {
+ return false; // nothing selected
+ }
+ }
return is_give_inventory_acceptable_ids(inventory_selected_uuids);
}
@@ -940,11 +950,18 @@ namespace action_give_inventory
static void give_inventory(const uuid_vec_t& avatar_uuids, const std::vector<LLAvatarName> avatar_names, LLInventoryPanel* panel = NULL)
{
llassert(avatar_names.size() == avatar_uuids.size());
+ std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(panel);;
- const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(panel);
if (inventory_selected_uuids.empty())
{
- return;
+ if(panel && panel->getRootFolder() && panel->getRootFolder()->isSingleFolderMode())
+ {
+ inventory_selected_uuids.insert(panel->getRootFolderID());
+ }
+ else
+ {
+ return;
+ }
}
give_inventory_ids(avatar_uuids, avatar_names, inventory_selected_uuids);
}
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 53753b6c6b..067758b99c 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -2304,15 +2304,7 @@ void LLInventorySingleFolderPanel::doCreate(const LLSD& userdata)
void LLInventorySingleFolderPanel::doShare()
{
- if(mFolderRoot.get()->getCurSelectedItem() == NULL)
- {
- std::set<LLUUID> uuids{mFolderID};
- LLAvatarActions::shareWithAvatars(uuids, gFloaterView->getParentFloater(this));
- }
- else
- {
- LLAvatarActions::shareWithAvatars(this);
- }
+ LLAvatarActions::shareWithAvatars(this);
}
/************************************************************************/
/* Asset Pre-Filtered Inventory Panel related class */