diff options
Diffstat (limited to 'indra/llui/lltoolbar.cpp')
-rw-r--r-- | indra/llui/lltoolbar.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index fe989cee22..caad896a06 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -204,7 +204,7 @@ bool LLToolBar::addCommand(const LLCommandId& commandId) LLCommand * command = LLCommandManager::instance().getCommand(commandId); if (!command) return false; - mButtonCommands.push_back(commandId); + mButtonCommands.push_back(commandId); LLToolBarButton* button = createButton(commandId); mButtons.push_back(button); mButtonPanel->addChild(button); @@ -505,14 +505,24 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) if (!commandp) return NULL; LLToolBarButton::Params button_p; + button_p.name = id.name(); button_p.label = LLTrans::getString(commandp->labelRef()); button_p.tool_tip = button_p.label(); button_p.image_overlay = LLUI::getUIImage(commandp->icon()); button_p.overwriteFrom(mButtonParams[mButtonType]); LLToolBarButton* button = LLUICtrlFactory::create<LLToolBarButton>(button_p); + if (!mReadOnly) + { + LLUICtrl::CommitCallbackParam cbParam; + cbParam.function_name = commandp->functionName(); + cbParam.parameter = commandp->parameter(); + button->setCommitCallback(cbParam); + } + button->setCommandId(id); return button; + } // |