diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2018-10-12 18:12:51 +0300 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2018-10-12 18:12:51 +0300 |
commit | 4d94cbd392886ee68a6a181d1fe321483db5ce37 (patch) | |
tree | 5af1ab3e95cd9455ec180dfb882b184abee03e9e | |
parent | a209d207d3f716329af06eaddb16e9fa72467ecd (diff) |
SL-9733 Implemented drag and drop support for presorted panel
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 31 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.h | 2 |
2 files changed, 31 insertions, 2 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 43904675d4..0dd37b6161 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -48,6 +48,7 @@ #include "llsidepanelinventory.h" #include "llstartup.h" #include "lltrans.h" +#include "llviewerassettype.h" #include "llviewerattachmenu.h" #include "llviewerfoldertype.h" #include "llvoavatarself.h" @@ -1762,11 +1763,17 @@ public: void initFromParams(const Params& p); protected: - LLAssetFilteredInventoryPanel(const Params& p) : LLInventoryPanel(p) { mAcceptsDragAndDrop = false; } + LLAssetFilteredInventoryPanel(const Params& p) : LLInventoryPanel(p) {} friend class LLUICtrlFactory; public: ~LLAssetFilteredInventoryPanel() {} + /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg) override; + protected: /*virtual*/ LLFolderViewItem* buildNewViews(const LLUUID& id) override; /*virtual*/ void itemChanged(const LLUUID& item_id, U32 mask, const LLInventoryObject* model_item) override; @@ -1786,6 +1793,28 @@ void LLAssetFilteredInventoryPanel::initFromParams(const Params& p) getFilter().setFilterNoMarketplaceFolder(); } +BOOL LLAssetFilteredInventoryPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg) +{ + BOOL result = FALSE; + + if (mAcceptsDragAndDrop) + { + EDragAndDropType allow_type = LLViewerAssetType::lookupDragAndDropType(mAssetType); + // Don't allow DAD_CATEGORY here since it can contain other items besides required assets + // We should see everything we drop! + if (allow_type == cargo_type) + { + result = LLInventoryPanel::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + } + } + + return result; +} + LLFolderViewItem* LLAssetFilteredInventoryPanel::buildNewViews(const LLUUID& id) { LLInventoryObject const* objectp = gInventory.getObject(id); diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index b968b19d9a..97e1c37a31 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -155,7 +155,7 @@ public: void draw(); /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask ); BOOL handleHover(S32 x, S32 y, MASK mask); - BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, |