diff options
Diffstat (limited to 'indra/newview/llinventorygallery.cpp')
-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); |