summaryrefslogtreecommitdiff
path: root/indra/llui/lltoolbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/lltoolbar.cpp')
-rw-r--r--indra/llui/lltoolbar.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 57a9151649..c5219b11e8 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -207,7 +207,7 @@ bool LLToolBar::addCommand(const LLCommandId& commandId)
if (add_command)
{
mButtonCommands.push_back(commandId);
- createButtons();
+ createButton(commandId);
}
return add_command;
@@ -498,19 +498,25 @@ void LLToolBar::createButtons()
BOOST_FOREACH(LLCommandId& command_id, mButtonCommands)
{
- LLCommand* commandp = LLCommandManager::instance().getCommand(command_id);
- if (!commandp) continue;
+ createButton(command_id);
+ }
- LLToolBarButton::Params button_p;
- button_p.label = LLTrans::getString(commandp->labelRef());
- button_p.image_overlay = LLUI::getUIImage(commandp->icon());
- button_p.overwriteFrom(mButtonParams[mButtonType]);
- LLToolBarButton* button = LLUICtrlFactory::create<LLToolBarButton>(button_p);
+}
- mButtons.push_back(button);
- mButtonPanel->addChild(button);
- }
+void LLToolBar::createButton(const LLCommandId& id)
+{
+ LLCommand* commandp = LLCommandManager::instance().getCommand(id);
+ if (!commandp) return;
+
+ LLToolBarButton::Params button_p;
+ 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);
+
+ mButtons.push_back(button);
+ mButtonPanel->addChild(button);
mNeedsLayout = true;
}
-