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.cpp46
1 files changed, 34 insertions, 12 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 21eeed1d27..e67e18872c 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -194,9 +194,9 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p)
mCenteringStack->addChild(LLUICtrlFactory::create<LLLayoutPanel>(border_panel_p));
- BOOST_FOREACH(LLCommandId::Params params, p.commands)
+ BOOST_FOREACH(LLCommandId id, p.commands)
{
- addCommand(params);
+ addCommand(id);
}
mNeedsLayout = true;
@@ -452,17 +452,17 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y)
{
// We hit passed the end of the list so put the insertion point at the end
if (orientation == LLLayoutStack::HORIZONTAL)
- {
+ {
mDragx = button_rect.mRight + mPadRight;
mDragy = button_rect.mTop + mPadTop;
- }
- else
- {
+ }
+ else
+ {
mDragx = button_rect.mLeft - mPadLeft;
mDragy = button_rect.mBottom - mPadBottom;
}
}
-
+
// Update the "girth" of the caret, i.e. the width or height (depending of orientation)
if (orientation == LLLayoutStack::HORIZONTAL)
{
@@ -723,13 +723,10 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id)
LLCommand* commandp = LLCommandManager::instance().getCommand(id);
if (!commandp) return NULL;
- std::string label = LLTrans::getString(commandp->labelRef());
- std::string tooltip = label + "\n" + LLTrans::getString(commandp->tooltipRef());
-
LLToolBarButton::Params button_p;
button_p.name = id.name();
- button_p.label = label;
- button_p.tool_tip = tooltip;
+ button_p.label = LLTrans::getString(commandp->labelRef());
+ button_p.tool_tip = LLTrans::getString(commandp->tooltipRef());
button_p.image_overlay = LLUI::getUIImage(commandp->icon());
button_p.overwriteFrom(mButtonParams[mButtonType]);
LLToolBarButton* button = LLUICtrlFactory::create<LLToolBarButton>(button_p);
@@ -925,3 +922,28 @@ void LLToolBarButton::reshape(S32 width, S32 height, BOOL called_from_parent)
{
LLButton::reshape(mWidthRange.clamp(width), height, called_from_parent);
}
+
+const std::string LLToolBarButton::getToolTip() const
+{
+ std::string tooltip;
+ if (labelIsTruncated() || getCurrentLabel().empty())
+ {
+ return LLTrans::getString(LLCommandManager::instance().getCommand(mId)->labelRef()) + " -- " + LLView::getToolTip();
+ }
+ else
+ {
+ return LLView::getToolTip();
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+