diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-03-29 21:20:39 +0300 |
---|---|---|
committer | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-03-29 21:20:39 +0300 |
commit | a6b71d3b8234261f4ed3674017736d04649ea992 (patch) | |
tree | 5b4e160e2952a89a9b12ce23224bc915d0ab1245 /indra/newview | |
parent | 205d6ef5d6d05f5a429f987a78f45bbb2359404d (diff) |
SL-19379 WIP allow dnd folders
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llinventorygallery.cpp | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index e31b6b1527..ad4124ff5b 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -1061,19 +1061,30 @@ BOOL LLInventoryGalleryItem::handleHover(S32 x, S32 y, MASK mask) { S32 screen_x; S32 screen_y; - const LLInventoryItem *item = gInventory.getItem(mUUID); - localPointToScreen(x, y, &screen_x, &screen_y ); - if(item && LLToolDragAndDrop::getInstance()->isOverThreshold(screen_x, screen_y)) + + if(LLToolDragAndDrop::getInstance()->isOverThreshold(screen_x, screen_y)) { - EDragAndDropType type = LLViewerAssetType::lookupDragAndDropType(item->getType()); - LLToolDragAndDrop::ESource src = LLToolDragAndDrop::SOURCE_LIBRARY; - if(item->getPermissions().getOwner() == gAgent.getID()) + const LLInventoryItem *item = gInventory.getItem(mUUID); + if(item) + { + EDragAndDropType type = LLViewerAssetType::lookupDragAndDropType(item->getType()); + LLToolDragAndDrop::ESource src = LLToolDragAndDrop::SOURCE_LIBRARY; + if(item->getPermissions().getOwner() == gAgent.getID()) + { + src = LLToolDragAndDrop::SOURCE_AGENT; + } + LLToolDragAndDrop::getInstance()->beginDrag(type, item->getUUID(), src); + return LLToolDragAndDrop::getInstance()->handleHover(x, y, mask ); + } + + const LLInventoryCategory *cat = gInventory.getCategory(mUUID); + if(cat && gInventory.isObjectDescendentOf(mUUID, gInventory.getRootFolderID()) + && !LLFolderType::lookupIsProtectedType((cat)->getPreferredType())) { - src = LLToolDragAndDrop::SOURCE_AGENT; + LLToolDragAndDrop::getInstance()->beginDrag(LLViewerAssetType::lookupDragAndDropType(cat->getType()), cat->getUUID(), LLToolDragAndDrop::SOURCE_AGENT); + return LLToolDragAndDrop::getInstance()->handleHover(x, y, mask ); } - LLToolDragAndDrop::getInstance()->beginDrag(type, item->getUUID(), src); - return LLToolDragAndDrop::getInstance()->handleHover(x, y, mask ); } } return LLUICtrl::handleHover(x,y,mask); |