From b9ed40255857fba7c58ae054796f308871c5e6d9 Mon Sep 17 00:00:00 2001 From: Paul Guslisty <pguslisty@productengine.com> Date: Tue, 23 Feb 2010 09:45:16 +0200 Subject: [PATCH] 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 --- indra/llui/lltabcontainer.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 07e4cc22e03..46d2f92ad09 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -172,6 +172,10 @@ class LLCustomButtonIconCtrl : public LLButton } } + 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), -- GitLab