From bb79bbf3209fbb962ca1b284076738eb5ba6019c Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 19 Jan 2012 13:53:48 -0800 Subject: EXP-1827 FIX -- Drag area in outbox does not always highlight green when indicating a top level drop * Updated the outbox drop area highlight to include top level drops within the outbox inventory panel itself. --- indra/newview/llfloateroutbox.cpp | 55 +++++++++++++++------------------------ 1 file changed, 21 insertions(+), 34 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 08cd8082aa..540f977305 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -376,44 +376,37 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); BOOL handled = (handled_view != NULL); + + // Determine if the mouse is inside the inventory panel itself or just within the floater + bool pointInInventoryPanel = false; + bool pointInInventoryPanelChild = false; + LLFolderView * root_folder = mOutboxInventoryPanel->getRootFolder(); + if (mOutboxInventoryPanel->getVisible()) + { + S32 inv_x, inv_y; + localPointToOtherView(x, y, &inv_x, &inv_y, mOutboxInventoryPanel); + + pointInInventoryPanel = mOutboxInventoryPanel->getRect().pointInRect(inv_x, inv_y); + + LLView * inventory_panel_child_at_point = mOutboxInventoryPanel->childFromPoint(inv_x, inv_y, true); + pointInInventoryPanelChild = (inventory_panel_child_at_point != root_folder); + } // Pass all drag and drop for this floater to the outbox inventory control 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; - - // If the inventory panel is visible, then only override it to the outbox root if we're outside the inventory panel + // Handle the drag and drop directly to the root of the outbox if we're not in the inventory panel // (otherwise the inventory panel itself will handle the drag and drop operation, without any override) - if (mOutboxInventoryPanel->getVisible()) - { - S32 inv_x, inv_y; - localPointToOtherView(x, y, &inv_x, &inv_y, mOutboxInventoryPanel); - - const LLRect& inv_rect = mOutboxInventoryPanel->getRect(); - - move_to_root = !inv_rect.pointInRect(inv_x, inv_y); - } - - // Handle the drag and drop directly to the root of the outbox - if (move_to_root) + if (!pointInInventoryPanel) { - LLFolderView * root_folder = mOutboxInventoryPanel->getRootFolder(); - handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); } - if (mOutboxTopLevelDropZone) - { - mOutboxTopLevelDropZone->setBackgroundVisible(handled && !drop && isAccepted(*accept)); - } + mOutboxTopLevelDropZone->setBackgroundVisible(handled && !drop && isAccepted(*accept)); } else { - if (mOutboxTopLevelDropZone) - { - mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); - } + mOutboxTopLevelDropZone->setBackgroundVisible(!pointInInventoryPanelChild); } return handled; @@ -421,20 +414,14 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, BOOL LLFloaterOutbox::handleHover(S32 x, S32 y, MASK mask) { - if (mOutboxTopLevelDropZone) - { - mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); - } + mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); return LLFloater::handleHover(x, y, mask); } void LLFloaterOutbox::onMouseLeave(S32 x, S32 y, MASK mask) { - if (mOutboxTopLevelDropZone) - { - mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); - } + mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); LLFloater::onMouseLeave(x, y, mask); } -- cgit v1.2.3