summaryrefslogtreecommitdiff
path: root/indra
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
parentba60e0906549840b8632d72f17b3f9bcda65e882 (diff)
EXP-1286 : DaD works between all toolbars, button drops in correct place, removal of button works too
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/lltoolbar.cpp16
-rw-r--r--indra/newview/lltoolbarview.cpp10
2 files changed, 15 insertions, 11 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);
diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp
index 3b8577862a..5f3e386035 100644
--- a/indra/newview/lltoolbarview.cpp
+++ b/indra/newview/lltoolbarview.cpp
@@ -329,7 +329,7 @@ void LLToolBarView::draw()
void LLToolBarView::startDragItem( S32 x, S32 y, const LLUUID& uuid)
{
- llinfos << "Merov debug: startDragItem() : x = " << x << ", y = " << y << llendl;
+ //llinfos << "Merov debug: startDragItem() : x = " << x << ", y = " << y << llendl;
LLToolDragAndDrop::getInstance()->setDragStart( x, y );
sDragStarted = false;
}
@@ -348,7 +348,7 @@ BOOL LLToolBarView::handleDragItem( S32 x, S32 y, const LLUUID& uuid, LLAssetTyp
gClipboard.setSourceObject(uuid,LLAssetType::AT_WIDGET);
LLToolDragAndDrop::ESource src = LLToolDragAndDrop::SOURCE_VIEWER;
LLUUID srcID;
- llinfos << "Merov debug: handleDragItem() : beginMultiDrag()" << llendl;
+ //llinfos << "Merov debug: handleDragItem() : beginMultiDrag()" << llendl;
LLToolDragAndDrop::getInstance()->beginMultiDrag(types, cargo_ids, src, srcID);
sDragStarted = true;
return TRUE;
@@ -365,12 +365,12 @@ BOOL LLToolBarView::handleDragItem( S32 x, S32 y, const LLUUID& uuid, LLAssetTyp
BOOL LLToolBarView::handleDrop( void* cargo_data, S32 x, S32 y, LLToolBar* toolbar)
{
LLInventoryItem* inv_item = (LLInventoryItem*)cargo_data;
- llinfos << "Merov debug : handleDrop. Drop " << inv_item->getUUID() << " named " << inv_item->getName() << " of type " << inv_item->getType() << llendl;
+ //llinfos << "Merov debug : handleDrop. Drop " << inv_item->getUUID() << " named " << inv_item->getName() << " of type " << inv_item->getType() << llendl;
LLAssetType::EType type = inv_item->getType();
if (type == LLAssetType::AT_WIDGET)
{
- llinfos << "Merov debug : handleDrop. Drop source is a widget -> drop it in place..." << llendl;
+ //llinfos << "Merov debug : handleDrop. Drop source is a widget -> drop it in place..." << llendl;
// Get the command from its uuid
LLCommandManager& mgr = LLCommandManager::instance();
LLCommand* command = mgr.getCommand(inv_item->getUUID());
@@ -388,7 +388,7 @@ BOOL LLToolBarView::handleDrop( void* cargo_data, S32 x, S32 y, LLToolBar* toolb
}
else
{
- llwarns << "Merov debug : handleDrop failing: command couldn't be found in manager" << llendl;
+ llwarns << "Command couldn't be found in command manager" << llendl;
}
}