summaryrefslogtreecommitdiff
path: root/indra/llui/lltabcontainer.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2026-10-20 16:20:00 +0800
committerErik Kundiman <erik@megapahit.org>2026-10-20 16:20:00 +0800
commit61e65e2c95779d29496e5859a6edac82fc3b1ddb (patch)
treee0d70b7af955610b2a414b914c50d15f7af21015 /indra/llui/lltabcontainer.cpp
parentbbe494697ab37919f10009af516c711a685ac98e (diff)
parent923f645a923e7f061f7ff2790d8510aa4b5ced36 (diff)
Merge tag 'Second_Life_Release#923f645a-26.5' into 26.5
Diffstat (limited to 'indra/llui/lltabcontainer.cpp')
-rw-r--r--indra/llui/lltabcontainer.cpp28
1 files changed, 17 insertions, 11 deletions
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 27f1dcb03d..0afc4de946 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -1258,7 +1258,6 @@ void LLTabContainer::removeTabPanel(LLPanel* child)
bool has_focus = gFocusMgr.childHasKeyboardFocus(this);
- // If the tab being deleted is the selected one, select a different tab.
for(std::vector<LLTabTuple*>::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter)
{
LLTabTuple* tuple = *iter;
@@ -1296,6 +1295,7 @@ void LLTabContainer::removeTabPanel(LLPanel* child)
// make sure we don't have more locked tabs than we have tabs
mLockedTabCount = llmin(getTabCount(), mLockedTabCount);
+ // If the tab being deleted is the selected one, select a different tab.
if (mCurrentTabIdx >= (S32)mTabList.size())
{
mCurrentTabIdx = static_cast<S32>(mTabList.size()) - 1;
@@ -1737,7 +1737,7 @@ void LLTabContainer::reshapeTuple(LLTabTuple* tuple)
{
S32 image_overlay_width = 0;
- if(mCustomIconCtrlUsed)
+ if (mCustomIconCtrlUsed)
{
LLCustomButtonIconCtrl* button = dynamic_cast<LLCustomButtonIconCtrl*>(tuple->mButton);
LLIconCtrl* icon_ctrl = button ? button->getIconCtrl() : NULL;
@@ -2195,12 +2195,22 @@ S32 LLTabContainer::getTotalTabWidth() const
void LLTabContainer::setTabVisibility( LLPanel const *aPanel, bool aVisible )
{
- for( tuple_list_t::const_iterator itr = mTabList.begin(); itr != mTabList.end(); ++itr )
+ S32 num_tabs = S32(mTabList.size());
+ for (S32 i = 0; i < num_tabs; ++i)
{
- LLTabTuple const *pTT = *itr;
- if( pTT->mTabPanel == aPanel )
+ LLTabTuple* tuple = mTabList[i];
+ if( tuple->mTabPanel == aPanel )
{
- pTT->mVisible = aVisible;
+ if (tuple->mVisible != aVisible)
+ {
+ tuple->mVisible = aVisible;
+ if (aVisible)
+ {
+ this->selectTab(i);
+ this->setVisible(true);
+ }
+ updateMaxScrollPos();
+ }
break;
}
}
@@ -2216,11 +2226,7 @@ void LLTabContainer::setTabVisibility( LLPanel const *aPanel, bool aVisible )
break;
}
}
-
- if( foundTab )
- this->setVisible( true );
- else
- this->setVisible( false );
+ this->setVisible( foundTab );
updateMaxScrollPos();
}