From d6add298d7c793eda1fee2c03b2ccf91df7f6102 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 13 Jan 2012 16:06:58 -0800 Subject: EXP-1802 FIX -- Create labeled drop target region at bottom of merchant outbox floater for easy top level drop access * Added generic drop zone that highlights green when its functionality will be used. --- indra/newview/llfloateroutbox.cpp | 34 ++- indra/newview/llfloateroutbox.h | 3 + .../default/xui/en/floater_merchant_outbox.xml | 241 +++++++++++---------- 3 files changed, 167 insertions(+), 111 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 597602d5ab..297736f3bd 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -111,6 +111,7 @@ LLFloaterOutbox::LLFloaterOutbox(const LLSD& key) , mOutboxId(LLUUID::null) , mOutboxInventoryPanel(NULL) , mOutboxItemCount(0) + , mOutboxTopLevelDropZone(NULL) , mWindowShade(NULL) { } @@ -140,7 +141,9 @@ BOOL LLFloaterOutbox::postBuild() mImportButton = getChild("outbox_import_btn"); mImportButton->setCommitCallback(boost::bind(&LLFloaterOutbox::onImportButtonClicked, this)); - + + mOutboxTopLevelDropZone = getChild("outbox_generic_drag_target"); + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLFloaterOutbox::onFocusReceived, this)); return TRUE; @@ -353,6 +356,11 @@ void LLFloaterOutbox::updateView() } } +bool isAccepted(EAcceptance accept) +{ + return (accept >= ACCEPT_YES_COPY_SINGLE); +} + BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, @@ -370,7 +378,7 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, BOOL handled = (handled_view != NULL); // Pass all drag and drop for this floater to the outbox inventory control - if (!handled || (*accept == ACCEPT_NO)) + if (!handled || !isAccepted(*accept)) { // Always assume we are going to move the drag and drop operation to the outbox root folder bool move_to_root = true; @@ -394,11 +402,33 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); } + + if (mOutboxTopLevelDropZone) + { + mOutboxTopLevelDropZone->setBackgroundVisible(handled && !drop && isAccepted(*accept)); + } + } + else + { + if (mOutboxTopLevelDropZone) + { + mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); + } } return handled; } +void LLFloaterOutbox::onMouseLeave(S32 x, S32 y, MASK mask) +{ + if (mOutboxTopLevelDropZone) + { + mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); + } + + LLFloater::onMouseLeave(x, y, mask); +} + void LLFloaterOutbox::onImportButtonClicked() { mOutboxInventoryPanel->clearSelection(); diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h index 58b7d6ec98..796c533059 100644 --- a/indra/newview/llfloateroutbox.h +++ b/indra/newview/llfloateroutbox.h @@ -66,6 +66,8 @@ public: void showNotification(const LLSD& notify); + void onMouseLeave(S32 x, S32 y, MASK mask); + protected: void fetchOutboxContents(); @@ -103,6 +105,7 @@ private: LLUUID mOutboxId; LLInventoryPanel * mOutboxInventoryPanel; U32 mOutboxItemCount; + LLPanel * mOutboxTopLevelDropZone; LLWindowShade * mWindowShade; }; diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml index c0f26413cb..498a9b6ce0 100644 --- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml +++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml @@ -1,24 +1,24 @@ - - 1 folder - [NUM] folders - Sending folders... - Initializing... - + + 1 folder + [NUM] folders + Sending folders... + Initializing... + - - - - Loading... - - - + bg_opaque_color="InventoryBackgroundColor"> + + + Loading... + + + - - -