summaryrefslogtreecommitdiff
path: root/indra/llui/lltabcontainer.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-01-22 15:18:08 -0800
committerTofu Linden <tofu.linden@lindenlab.com>2010-01-22 15:18:08 -0800
commit9e0920df2c8ada63397ea6e439b02ee5b40d1bf6 (patch)
tree26f6af13d1dcd9d02c48bd7897b3604481f3734c /indra/llui/lltabcontainer.cpp
parentb96e52b72ab598a57d981c850b5f14b1ac406325 (diff)
parent4cf79224d099c4fc8bdfd9617e95a776d5a028d4 (diff)
Merge from v2 trunk.
Diffstat (limited to 'indra/llui/lltabcontainer.cpp')
-rw-r--r--indra/llui/lltabcontainer.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 327dd01612..43c44f2253 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -1507,6 +1507,37 @@ void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const L
}
}
+void LLTabContainer::setTabImage(LLPanel* child, const LLUUID& image_id, const LLColor4& color)
+{
+ static LLUICachedControl<S32> tab_padding ("UITabPadding", 0);
+ LLTabTuple* tuple = getTabByPanel(child);
+ if( tuple )
+ {
+ tuple->mButton->setImageOverlay(image_id, LLFontGL::RIGHT, color);
+
+ if (!mIsVertical)
+ {
+ // remove current width from total tab strip width
+ mTotalTabWidth -= tuple->mButton->getRect().getWidth();
+
+ S32 image_overlay_width = tuple->mButton->getImageOverlay().notNull() ?
+ tuple->mButton->getImageOverlay()->getImage()->getWidth(0) :
+ 0;
+
+ tuple->mPadding = image_overlay_width;
+
+ tuple->mButton->setRightHPad(6);
+ tuple->mButton->reshape(llclamp(mFont->getWidth(tuple->mButton->getLabelSelected()) + tab_padding + tuple->mPadding, mMinTabWidth, mMaxTabWidth),
+ tuple->mButton->getRect().getHeight());
+ // add back in button width to total tab strip width
+ mTotalTabWidth += tuple->mButton->getRect().getWidth();
+
+ // tabs have changed size, might need to scroll to see current tab
+ updateMaxScrollPos();
+ }
+ }
+}
+
void LLTabContainer::setTitle(const std::string& title)
{
if (mTitleBox)