diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-23 10:49:56 +0000 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-23 10:49:56 +0000 |
commit | 0cd1b3f776a25c8c99dc4256348b118e93c9cd2a (patch) | |
tree | 97f0c51f91cefd87549f05b9d164908854ba385c /indra/llui/lltabcontainer.cpp | |
parent | 37291bea8d9b5a626b449d984856e280e159ac5c (diff) | |
parent | b9ed40255857fba7c58ae054796f308871c5e6d9 (diff) |
PE merge.
Diffstat (limited to 'indra/llui/lltabcontainer.cpp')
-rw-r--r-- | indra/llui/lltabcontainer.cpp | 21 |
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), |