summaryrefslogtreecommitdiff
path: root/indra/llui/lltoolbar.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2011-10-11 15:16:45 -0700
committerMerov Linden <merov@lindenlab.com>2011-10-11 15:16:45 -0700
commit682609d254fb973cfa267923b69c5e06b7efd7e1 (patch)
tree0063e23841b6e3bb588355ad428608bb1f4fcdf9 /indra/llui/lltoolbar.cpp
parent3596c0f7e139724f31258ffb96157146aeba77b1 (diff)
parentc1a9ca33b27f4e741eeacf781a09156009167ad3 (diff)
Pull from richard/viewer-experience-fui
Diffstat (limited to 'indra/llui/lltoolbar.cpp')
-rw-r--r--indra/llui/lltoolbar.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 7c1e2017c0..d4633d7c3b 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -700,11 +700,25 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id)
if (!mReadOnly)
{
- LLUICtrl::CommitCallbackParam cbParam;
- cbParam.function_name = commandp->executeFunctionName();
- cbParam.parameter = commandp->executeParameters();
+ LLUICtrl::CommitCallbackParam executeParam;
+ executeParam.function_name = commandp->executeFunctionName();
+ executeParam.parameter = commandp->executeParameters();
- button->setCommitCallback(cbParam);
+ // If we have a "stop" function then we map the command to mouse down / mouse up otherwise commit
+ const std::string& executeStopFunction = commandp->executeStopFunctionName();
+ if (executeStopFunction.length() > 0)
+ {
+ LLUICtrl::CommitCallbackParam executeStopParam;
+ executeStopParam.function_name = executeStopFunction;
+ executeStopParam.parameter = commandp->executeStopParameters();
+
+ button->setMouseDownCallback(executeParam);
+ button->setMouseUpCallback(executeStopParam);
+ }
+ else
+ {
+ button->setCommitCallback(executeParam);
+ }
const std::string& isEnabledFunction = commandp->isEnabledFunctionName();
if (isEnabledFunction.length() > 0)