summaryrefslogtreecommitdiff
path: root/indra/llui/lltabcontainer.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-10-08 18:31:52 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-10-08 18:31:52 +0300
commitb16ede862f3e1414eee044c5a2b49017706af943 (patch)
tree5e223816b20f02185a487224d8dcc0dbf406142d /indra/llui/lltabcontainer.cpp
parenta301fb2876835f799317f8a011f368eaec4894d6 (diff)
parenta43b2106853b516248a2e657a28084b7d906cf5f (diff)
Merge branch 'develop' into marchcat/xcode-16
# Conflicts: # .github/workflows/build.yaml # indra/llmath/raytrace.cpp
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 5e0985c79c..7c9aa42e5f 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;
@@ -1723,7 +1723,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;
@@ -2173,12 +2173,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;
}
}
@@ -2194,11 +2204,7 @@ void LLTabContainer::setTabVisibility( LLPanel const *aPanel, bool aVisible )
break;
}
}
-
- if( foundTab )
- this->setVisible( true );
- else
- this->setVisible( false );
+ this->setVisible( foundTab );
updateMaxScrollPos();
}