summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2011-10-19 17:33:10 -0700
committerLeslie Linden <leslie@lindenlab.com>2011-10-19 17:33:10 -0700
commitf3a4a48d8ed20b4bbd65d7cdb9b191c9faf2544b (patch)
treebc9c2d1e44b031b311d9edec8d5963a7c732c24b /indra/llui
parent04d6bd302ba5809dc6aa1c33d91dc0737af6e033 (diff)
* Fixed issue where dragging disabled buttons from the toybox to the toybox
would remove them from the surrounding toolbars. * Removed dead drag & drop code * Fixed issue where saving didn't necessarily work because toolbar populated with command id's that didn't have associated names.
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lltoolbar.cpp10
-rw-r--r--indra/llui/lltoolbar.h3
2 files changed, 7 insertions, 6 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index c559a2bf1d..bceda9bf54 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -217,7 +217,7 @@ bool LLToolBar::addCommand(const LLCommandId& commandId, int rank)
if ((rank >= mButtonCommands.size()) || (rank == RANK_NONE))
{
// In that case, back load
- mButtonCommands.push_back(commandId);
+ mButtonCommands.push_back(command->id());
mButtons.push_back(button);
}
else
@@ -232,7 +232,7 @@ bool LLToolBar::addCommand(const LLCommandId& commandId, int rank)
rank--;
}
// ...then insert
- mButtonCommands.insert(it_command,commandId);
+ mButtonCommands.insert(it_command, command->id());
mButtons.insert(it_button,button);
}
@@ -821,7 +821,7 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id)
if (!commandp) return NULL;
LLToolBarButton::Params button_p;
- button_p.name = id.name();
+ button_p.name = commandp->id().name(); // Make sure to retrieve the name from the command itself, not the passed in id
button_p.label = LLTrans::getString(commandp->labelRef());
button_p.tool_tip = LLTrans::getString(commandp->tooltipRef());
button_p.image_overlay = LLUI::getUIImage(commandp->icon());
@@ -999,13 +999,13 @@ BOOL LLToolBarButton::handleHover(S32 x, S32 y, MASK mask)
{
if (!mIsDragged)
{
- mStartDragItemCallback(x,y,mId.uuid());
+ mStartDragItemCallback(x, y, this);
mIsDragged = true;
handled = TRUE;
}
else
{
- handled = mHandleDragItemCallback(x,y,mId.uuid(),LLAssetType::AT_WIDGET);
+ handled = mHandleDragItemCallback(x, y, mId.uuid(), LLAssetType::AT_WIDGET);
}
}
else
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h
index ad42d1fa35..e634e57f93 100644
--- a/indra/llui/lltoolbar.h
+++ b/indra/llui/lltoolbar.h
@@ -36,8 +36,9 @@
#include "llassettype.h"
class LLToolBar;
+class LLToolBarButton;
-typedef boost::function<void (S32 x, S32 y, const LLUUID& uuid)> tool_startdrag_callback_t;
+typedef boost::function<void (S32 x, S32 y, LLToolBarButton* button)> tool_startdrag_callback_t;
typedef boost::function<BOOL (S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type)> tool_handledrag_callback_t;
typedef boost::function<BOOL (void* data, S32 x, S32 y, LLToolBar* toolbar)> tool_handledrop_callback_t;