diff options
author | Merov Linden <merov@lindenlab.com> | 2015-01-31 20:47:40 -0800 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2015-01-31 20:47:40 -0800 |
commit | 626d465894b0147b9cbefb15f7cfd8db38d72f00 (patch) | |
tree | 36dfc7fc31b761e76a06e8e39a126c7a89671ce0 /indra/newview | |
parent | 2377eba9874a89b84319ba38b05408ebcbf9155f (diff) |
DD-321 : Fix the drop zone to react really on the drop zone
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llfloatermarketplacelistings.cpp | 39 | ||||
-rwxr-xr-x | indra/newview/llfloatermarketplacelistings.h | 5 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/panel_marketplace_listings.xml | 2 |
3 files changed, 32 insertions, 14 deletions
diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index f4c138b890..cd76cabfbd 100755 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -73,6 +73,23 @@ BOOL LLPanelMarketplaceListings::postBuild() return LLPanel::postBuild(); } +BOOL LLPanelMarketplaceListings::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg) +{ + LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + BOOL handled = (handled_view != NULL); + // Special case the drop zone + if (handled && (handled_view->getName() == "marketplace_drop_zone")) + { + LLFolderView* root_folder = getRootFolder(); + handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + } + return handled; +} + void LLPanelMarketplaceListings::buildAllPanels() { // Build the All panel first @@ -570,26 +587,22 @@ BOOL LLFloaterMarketplaceListings::handleDragAndDrop(S32 x, S32 y, MASK mask, BO return FALSE; } + tooltip_msg = ""; + // Pass to the children LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); BOOL handled = (handled_view != NULL); - // If no one handled it or it was not accepted, we try to accept it at the floater level as if it was dropped on the - // marketplace listings root folder - if (!handled || !isAccepted(*accept)) + // If no one handled it or it was not accepted and we drop on an empty panel, we try to accept it at the floater level + // as if it was dropped on the marketplace listings root folder + if ((!handled || !isAccepted(*accept)) && !mPanelListings->getVisible() && mRootFolderId.notNull()) { - if ((LLMarketplaceData::instance().getSLMStatus() >= MarketplaceStatusCodes::MARKET_PLACE_MERCHANT) && mRootFolderId.notNull()) + if (!mPanelListingsSet) { - if (!mPanelListingsSet) - { - setPanels(); - } - if (mPanelListings->allowDropOnRoot()) - { - LLFolderView* root_folder = mPanelListings->getRootFolder(); - handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); - } + setPanels(); } + LLFolderView* root_folder = mPanelListings->getRootFolder(); + handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); } return handled; diff --git a/indra/newview/llfloatermarketplacelistings.h b/indra/newview/llfloatermarketplacelistings.h index f6aa0ef0a6..594451ede4 100755 --- a/indra/newview/llfloatermarketplacelistings.h +++ b/indra/newview/llfloatermarketplacelistings.h @@ -52,6 +52,11 @@ class LLPanelMarketplaceListings : public LLPanel public: LLPanelMarketplaceListings(); BOOL postBuild(); + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg); void draw(); LLFolderView* getRootFolder() { return mRootFolder; } bool allowDropOnRoot(); diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml index 68d75440bd..2b17473a84 100755 --- a/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml @@ -86,7 +86,7 @@ </panel> <panel name="marketplace_drop_zone" - mouse_opaque="false" + mouse_opaque="true" follows="bottom|left|right" left="2" width="306" |