From 1f5a6bb6b65261733c654aaec1cf3dfc8de87018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?miKa=E3=81=B4=E3=82=87=E3=82=93?= Date: Wed, 14 Oct 2015 20:48:23 +0200 Subject: [PATCH] Disable vertical tab resizing over maximum width In some situations, the label of tabs changes which caused the tab to resize. For example, when using vertical tabs for instant messages in combination with "Display Names (w/Username)" for chat tabs, the display name does not instantly load sometimes (when not in the avatar name cache?) and the username is set. After the display name loads the tab label is set to the display name which triggered a resizing of the tab and could cause it to overlap the chat box. --- indra/llui/lltabcontainer.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index a86527f56..4d92cafd1 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -1460,10 +1460,18 @@ void LLTabContainer::setPanelTitle(S32 index, const std::string& title) { LLTabTuple* tuple = getTab(index); LLButton* tab_button = tuple->mButton; - const LLFontGL* fontp = LLFontGL::getFontSansSerifSmall(); - mTotalTabWidth -= tab_button->getRect().getWidth(); - tab_button->reshape(llclamp(fontp->getWidth(title) + TAB_PADDING + tuple->mPadding, mMinTabWidth, mMaxTabWidth), tab_button->getRect().getHeight()); - mTotalTabWidth += tab_button->getRect().getWidth(); + if (!mIsVertical) + { + const LLFontGL* fontp = LLFontGL::getFontSansSerifSmall(); + mTotalTabWidth -= tab_button->getRect().getWidth(); + tab_button->reshape(llclamp(fontp->getWidth(title) + + TAB_PADDING + + tuple->mPadding, + mMinTabWidth, + mMaxTabWidth), + tab_button->getRect().getHeight()); + mTotalTabWidth += tab_button->getRect().getWidth(); + } tab_button->setLabelSelected(title); tab_button->setLabelUnselected(title); }