summaryrefslogtreecommitdiff
path: root/indra/llui/lltabcontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/lltabcontainer.cpp')
-rw-r--r--indra/llui/lltabcontainer.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 07e4cc22e0..46d2f92ad0 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -172,6 +172,10 @@ public:
}
}
+ LLIconCtrl* getIconCtrl() const
+ {
+ return mIcon;
+ }
private:
LLIconCtrl* mIcon;
@@ -1629,6 +1633,7 @@ void LLTabContainer::setTabImage(LLPanel* child, LLIconCtrl* icon)
if(button)
{
button->setIcon(icon);
+ reshapeTuple(tuple);
}
}
}
@@ -1639,12 +1644,22 @@ void LLTabContainer::reshapeTuple(LLTabTuple* tuple)
if (!mIsVertical)
{
+ S32 image_overlay_width = 0;
+
+ if(mCustomIconCtrlUsed)
+ {
+ LLCustomButtonIconCtrl* button = dynamic_cast<LLCustomButtonIconCtrl*>(tuple->mButton);
+ LLIconCtrl* icon_ctrl = button->getIconCtrl();
+ image_overlay_width = icon_ctrl ? icon_ctrl->getRect().getWidth() : 0;
+ }
+ else
+ {
+ image_overlay_width = tuple->mButton->getImageOverlay().notNull() ?
+ tuple->mButton->getImageOverlay()->getImage()->getWidth(0) : 0;
+ }
// 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->reshape(llclamp(mFont->getWidth(tuple->mButton->getLabelSelected()) + tab_padding + tuple->mPadding, mMinTabWidth, mMaxTabWidth),