summaryrefslogtreecommitdiff
path: root/indra/llui/lltabcontainer.cpp
diff options
context:
space:
mode:
authorPaul Guslisty <pguslisty@productengine.com>2010-02-23 09:45:16 +0200
committerPaul Guslisty <pguslisty@productengine.com>2010-02-23 09:45:16 +0200
commitb9ed40255857fba7c58ae054796f308871c5e6d9 (patch)
tree6d3fd32e08ccab63342419ceb0e7c02fc697bfe3 /indra/llui/lltabcontainer.cpp
parentd47ca7a671255adf6c4f16114516effde507ae3a (diff)
Fxed normal bug EXT - 5465 (Invalid ellipsis usage for resident names in the IM tabs)
- Added reshaping procedure for tabs with LLIconCtrl --HG-- branch : product-engine
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),