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
No related branches found
No related tags found
No related merge requests found
...@@ -376,44 +376,37 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, ...@@ -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); 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);
// 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 // Pass all drag and drop for this floater to the outbox inventory control
if (!handled || !isAccepted(*accept)) if (!handled || !isAccepted(*accept))
{ {
// Always assume we are going to move the drag and drop operation to the outbox root folder // Handle the drag and drop directly to the root of the outbox if we're not in the inventory panel
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) // (otherwise the inventory panel itself will handle the drag and drop operation, without any override)
if (mOutboxInventoryPanel->getVisible()) if (!pointInInventoryPanel)
{
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)
{ {
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;
...@@ -421,20 +414,14 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, ...@@ -421,20 +414,14 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
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.
Finish editing this message first!
Please register or to comment