From 09b750483a2cde7ea3c80a0238f3224a2cf1cb70 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Thu, 3 Jan 2019 22:59:49 +0200 Subject: SL-10293 Firestorm PR: preferences and menu search --- indra/llui/lltabcontainer.cpp | 50 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) (limited to 'indra/llui/lltabcontainer.cpp') diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 1b2f09cff5..9c8636f936 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -76,7 +76,8 @@ public: mButton(b), mOldState(FALSE), mPlaceholderText(placeholder), - mPadding(0) + mPadding(0), + mVisible(true) {} LLTabContainer* mTabContainer; @@ -85,6 +86,8 @@ public: BOOL mOldState; LLTextBox* mPlaceholderText; S32 mPadding; + + mutable bool mVisible; }; //---------------------------------------------------------------------------- @@ -398,7 +401,10 @@ void LLTabContainer::draw() { break; } - target_pixel_scroll += (*iter)->mButton->getRect().getWidth(); + + if( (*iter)->mVisible ) + target_pixel_scroll += (*iter)->mButton->getRect().getWidth(); + cur_scroll_pos--; } @@ -467,6 +473,12 @@ void LLTabContainer::draw() { LLTabTuple* tuple = *iter; + if( !tuple->mVisible ) + { + tuple->mButton->setVisible( false ); + continue; + } + tuple->mButton->translate( left ? left - tuple->mButton->getRect().mLeft : 0, top ? top - tuple->mButton->getRect().mTop : 0 ); if (top) top -= BTN_HEIGHT + tabcntrv_pad; @@ -1505,7 +1517,7 @@ BOOL LLTabContainer::setTab(S32 which) } BOOL is_visible = FALSE; - if (selected_tuple->mButton->getEnabled()) + if( selected_tuple->mButton->getEnabled() && selected_tuple->mVisible ) { setCurrentPanelIndex(which); @@ -2121,3 +2133,35 @@ S32 LLTabContainer::getTotalTabWidth() const { return mTotalTabWidth; } + +void LLTabContainer::setTabVisibility( LLPanel const *aPanel, bool aVisible ) +{ + for( tuple_list_t::const_iterator itr = mTabList.begin(); itr != mTabList.end(); ++itr ) + { + LLTabTuple const *pTT = *itr; + if( pTT->mTabPanel == aPanel ) + { + pTT->mVisible = aVisible; + break; + } + } + + bool foundTab( false ); + for( tuple_list_t::const_iterator itr = mTabList.begin(); itr != mTabList.end(); ++itr ) + { + LLTabTuple const *pTT = *itr; + if( pTT->mVisible ) + { + this->selectTab( itr - mTabList.begin() ); + foundTab = true; + break; + } + } + + if( foundTab ) + this->setVisible( TRUE ); + else + this->setVisible( FALSE ); + + updateMaxScrollPos(); +} -- cgit v1.2.3 From 1349eacc5cddb8d8522b4250cd3e7e54de55de2d Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 9 Jan 2019 17:21:13 +0200 Subject: SL-10325 FIXED Preferences tabs are displayed incorrectly if hovering it while searching any keyword --- indra/llui/lltabcontainer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/llui/lltabcontainer.cpp') diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 9c8636f936..6521b883f8 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -736,11 +736,11 @@ BOOL LLTabContainer::handleToolTip( S32 x, S32 y, MASK mask) { for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) { - LLTabTuple* tuple = *iter; - tuple->mButton->setVisible( TRUE ); - S32 local_x = x - tuple->mButton->getRect().mLeft; - S32 local_y = y - tuple->mButton->getRect().mBottom; - handled = tuple->mButton->handleToolTip( local_x, local_y, mask); + LLButton* tab_button = (*iter)->mButton; + if (!tab_button->getVisible()) continue; + S32 local_x = x - tab_button->getRect().mLeft; + S32 local_y = y - tab_button->getRect().mBottom; + handled = tab_button->handleToolTip(local_x, local_y, mask); if( handled ) { break; -- cgit v1.2.3