Skip to content

Commit

Permalink
Disable vertical tab resizing over maximum width
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
miKa-pyon committed Oct 14, 2015
1 parent 2bf0a91 commit 1f5a6bb
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions indra/llui/lltabcontainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1f5a6bb

Please sign in to comment.