summaryrefslogtreecommitdiff
path: root/indra/llui/lltoolbar.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2011-10-05 14:47:50 -0700
committerMerov Linden <merov@lindenlab.com>2011-10-05 14:47:50 -0700
commit00dc8b3982cf69dbe69b8c1913e701c37f22eba0 (patch)
treeaf636792c1d6094eb58c9d1bb8d9cdd7c2fac542 /indra/llui/lltoolbar.cpp
parentba60e0906549840b8632d72f17b3f9bcda65e882 (diff)
EXP-1286 : DaD works between all toolbars, button drops in correct place, removal of button works too
Diffstat (limited to 'indra/llui/lltoolbar.cpp')
-rw-r--r--indra/llui/lltoolbar.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 07beb147d7..9ffb859053 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -382,6 +382,11 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y)
int rank = 0;
LLLayoutStack::ELayoutOrientation orientation = getOrientation(mSideType);
+ S32 button_panel_x = 0;
+ S32 button_panel_y = 0;
+ localPointToOtherView(x, y, &button_panel_x, &button_panel_y, mButtonPanel);
+
+ //llinfos << "Merov debug : rank compute: orientation = " << orientation << ", x = " << button_panel_x << ", y = " << button_panel_y << llendl;
// Simply compare the passed coord with the buttons outbound box
std::list<LLToolBarButton*>::iterator it_button = mButtons.begin();
@@ -389,17 +394,16 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y)
while (it_button != end_button)
{
LLRect button_rect = (*it_button)->getRect();
- if (((orientation == LLLayoutStack::HORIZONTAL) && (button_rect.mRight > x)) ||
- ((orientation == LLLayoutStack::VERTICAL) && (button_rect.mTop > y)) )
+ //llinfos << "Merov debug : rank compute: rect = " << button_rect.mLeft << ", " << button_rect.mTop << ", " << button_rect.mRight << ", " << button_rect.mBottom << llendl;
+ if (((orientation == LLLayoutStack::HORIZONTAL) && (button_rect.mRight > button_panel_x)) ||
+ ((orientation == LLLayoutStack::VERTICAL) && (button_rect.mBottom < button_panel_y)) )
{
- llinfos << "Merov debug : rank compute: orientation = " << orientation << ", x = " << x << ", y = " << y << llendl;
- llinfos << "Merov debug : rank compute: rect = " << button_rect.mLeft << ", " << button_rect.mTop << ", " << button_rect.mRight << ", " << button_rect.mBottom << llendl;
break;
}
rank++;
++it_button;
}
- llinfos << "Merov debug : rank = " << rank << llendl;
+ //llinfos << "Merov debug : rank = " << rank << llendl;
return rank;
}
@@ -619,7 +623,7 @@ BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
EAcceptance* accept,
std::string& tooltip_msg)
{
- llinfos << "Merov debug : handleDragAndDrop. drop = " << drop << ", x = " << x << ", y = " << y << llendl;
+ //llinfos << "Merov debug : handleDragAndDrop. drop = " << drop << ", x = " << x << ", y = " << y << llendl;
// If we have a drop callback, that means that we can handle the drop
BOOL handled = (mHandleDropCallback ? TRUE : FALSE);