Skip to content
Snippets Groups Projects
Commit bb79bbf3 authored by Leslie Linden's avatar Leslie Linden
Browse files

EXP-1827 FIX -- Drag area in outbox does not always highlight green when...

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.
parent 02641d4e
Branches
Tags
No related merge requests found
...@@ -377,64 +377,51 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, ...@@ -377,64 +377,51 @@ 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); LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
BOOL handled = (handled_view != NULL); BOOL handled = (handled_view != NULL);
// Pass all drag and drop for this floater to the outbox inventory control // Determine if the mouse is inside the inventory panel itself or just within the floater
if (!handled || !isAccepted(*accept)) bool pointInInventoryPanel = false;
{ bool pointInInventoryPanelChild = false;
// Always assume we are going to move the drag and drop operation to the outbox root folder LLFolderView * root_folder = mOutboxInventoryPanel->getRootFolder();
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
// (otherwise the inventory panel itself will handle the drag and drop operation, without any override)
if (mOutboxInventoryPanel->getVisible()) if (mOutboxInventoryPanel->getVisible())
{ {
S32 inv_x, inv_y; S32 inv_x, inv_y;
localPointToOtherView(x, y, &inv_x, &inv_y, mOutboxInventoryPanel); localPointToOtherView(x, y, &inv_x, &inv_y, mOutboxInventoryPanel);
const LLRect& inv_rect = mOutboxInventoryPanel->getRect(); pointInInventoryPanel = mOutboxInventoryPanel->getRect().pointInRect(inv_x, inv_y);
move_to_root = !inv_rect.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);
} }
// Handle the drag and drop directly to the root of the outbox // Pass all drag and drop for this floater to the outbox inventory control
if (move_to_root) if (!handled || !isAccepted(*accept))
{
// 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 (!pointInInventoryPanel)
{ {
LLFolderView * root_folder = mOutboxInventoryPanel->getRootFolder();
handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); 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 else
{ {
if (mOutboxTopLevelDropZone) mOutboxTopLevelDropZone->setBackgroundVisible(!pointInInventoryPanelChild);
{
mOutboxTopLevelDropZone->setBackgroundVisible(FALSE);
}
} }
return handled; return handled;
} }
BOOL LLFloaterOutbox::handleHover(S32 x, S32 y, MASK mask) BOOL LLFloaterOutbox::handleHover(S32 x, S32 y, MASK mask)
{
if (mOutboxTopLevelDropZone)
{ {
mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); mOutboxTopLevelDropZone->setBackgroundVisible(FALSE);
}
return LLFloater::handleHover(x, y, mask); return LLFloater::handleHover(x, y, mask);
} }
void LLFloaterOutbox::onMouseLeave(S32 x, S32 y, MASK mask) void LLFloaterOutbox::onMouseLeave(S32 x, S32 y, MASK mask)
{
if (mOutboxTopLevelDropZone)
{ {
mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); mOutboxTopLevelDropZone->setBackgroundVisible(FALSE);
}
LLFloater::onMouseLeave(x, y, mask); LLFloater::onMouseLeave(x, y, mask);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment