summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2011-10-05 17:04:07 -0700
committerMerov Linden <merov@lindenlab.com>2011-10-05 17:04:07 -0700
commit64d005bfed6c5adcd29df3ae0774747480a0d839 (patch)
tree5bcc21f9bb697f20a2a828a8a40ca9c3abd8e217 /indra/newview
parenta88bb3231b2685eb640710d7617d26b7f3a2c0d2 (diff)
EXP-1286 : Add DaD to toybox
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloatertoybox.cpp5
-rw-r--r--indra/newview/lltoolbarview.cpp16
2 files changed, 13 insertions, 8 deletions
diff --git a/indra/newview/llfloatertoybox.cpp b/indra/newview/llfloatertoybox.cpp
index cf22e071aa..58bb417b71 100644
--- a/indra/newview/llfloatertoybox.cpp
+++ b/indra/newview/llfloatertoybox.cpp
@@ -62,7 +62,10 @@ BOOL LLFloaterToybox::postBuild()
mBtnRestoreDefaults = getChild<LLButton>("btn_restore_defaults");
mToolBar = getChild<LLToolBar>("toybox_toolbar");
-
+ mToolBar->setStartDragCallback(boost::bind(LLToolBarView::startDragItem,_1,_2,_3));
+ mToolBar->setHandleDragCallback(boost::bind(LLToolBarView::handleDragItem,_1,_2,_3,_4));
+ mToolBar->setHandleDropCallback(boost::bind(LLToolBarView::handleDrop,_1,_2,_3,_4));
+
LLCommandManager& cmdMgr = LLCommandManager::instance();
//
diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp
index 5f3e386035..c0408e4850 100644
--- a/indra/newview/lltoolbarview.cpp
+++ b/indra/newview/lltoolbarview.cpp
@@ -377,24 +377,26 @@ BOOL LLToolBarView::handleDrop( void* cargo_data, S32 x, S32 y, LLToolBar* toolb
if (command)
{
// Convert the (x,y) position in rank in toolbar
- int rank = toolbar->getRankFromPosition(x,y);
+ int rank = 0;
+ if (!toolbar->isReadOnly())
+ {
+ rank = toolbar->getRankFromPosition(x,y);
+ }
// Suppress the command from the toolbars (including the one it's dropped in,
// this will handle move position).
gToolBarView->mToolbarLeft->removeCommand(command->id());
gToolBarView->mToolbarRight->removeCommand(command->id());
gToolBarView->mToolbarBottom->removeCommand(command->id());
// Now insert it in the toolbar at the detected rank
- toolbar->addCommand(command->id(),rank);
+ if (!toolbar->isReadOnly())
+ {
+ toolbar->addCommand(command->id(),rank);
+ }
}
else
{
llwarns << "Command couldn't be found in command manager" << llendl;
}
-
- }
- else
- {
- llinfos << "Merov debug : handleDrop. Drop source is not a widget -> nothing to do" << llendl;
}
return TRUE;