summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmaininventory.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2023-05-31 17:03:19 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2023-05-31 17:03:19 +0300
commitc3e200cef41a602c13d3115cfec777eff63d5028 (patch)
tree8ca032efe6df5780f8d1d5c6733d20486010aab0 /indra/newview/llpanelmaininventory.cpp
parenta6efb920e8e0d9add76ec86c3ed158c691685727 (diff)
SL-19686 don't search views every time
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r--indra/newview/llpanelmaininventory.cpp38
1 files changed, 24 insertions, 14 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 381506c2a6..16f7abee23 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -249,6 +249,16 @@ BOOL LLPanelMainInventory::postBuild()
mVisibilityMenuButton = getChild<LLMenuButton>("options_visibility_btn");
mViewMenuButton = getChild<LLMenuButton>("view_btn");
+ mBackBtn = getChild<LLButton>("back_btn");
+ mForwardBtn = getChild<LLButton>("forward_btn");
+ mUpBtn = getChild<LLButton>("up_btn");
+ mViewModeBtn = getChild<LLButton>("view_mode_btn");
+ mNavigationBtnsPanel = getChild<LLLayoutPanel>("nav_buttons");
+
+ mDefaultViewPanel = getChild<LLPanel>("default_inventory_panel");
+ mListViewPanel = getChild<LLPanel>("single_folder_inventory");
+ mGalleryViewPanel = getChild<LLPanel>("gallery_view_inventory");
+
mSingleFolderPanelInventory = getChild<LLInventorySingleFolderPanel>("single_folder_inv");
mListViewRootUpdatedConnection = mSingleFolderPanelInventory->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this));
mSingleFolderPanelInventory->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mSingleFolderPanelInventory, _1, _2));
@@ -1543,11 +1553,11 @@ void LLPanelMainInventory::toggleViewMode()
mCombinationGalleryPanel->updateRootFolder();
}
- getChild<LLPanel>("default_inventory_panel")->setVisible(!mSingleFolderMode);
- getChild<LLPanel>("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode());
- getChild<LLPanel>("gallery_view_inventory")->setVisible(mSingleFolderMode && isGalleryViewMode());
- getChild<LLLayoutPanel>("nav_buttons")->setVisible(mSingleFolderMode);
- getChild<LLButton>("view_mode_btn")->setImageOverlay(mSingleFolderMode ? getString("default_mode_btn") : getString("single_folder_mode_btn"));
+ mDefaultViewPanel->setVisible(!mSingleFolderMode);
+ mListViewPanel->setVisible(mSingleFolderMode && isListViewMode());
+ mGalleryViewPanel->setVisible(mSingleFolderMode && isGalleryViewMode());
+ mNavigationBtnsPanel->setVisible(mSingleFolderMode);
+ mViewModeBtn->setImageOverlay(mSingleFolderMode ? getString("default_mode_btn") : getString("single_folder_mode_btn"));
mCombinationScrollPanel->setVisible(mSingleFolderMode && isCombinationViewMode());
setActivePanel();
@@ -2396,23 +2406,23 @@ void LLPanelMainInventory::updateNavButtons()
{
if(isListViewMode())
{
- getChild<LLButton>("back_btn")->setEnabled(mSingleFolderPanelInventory->isBackwardAvailable());
- getChild<LLButton>("forward_btn")->setEnabled(mSingleFolderPanelInventory->isForwardAvailable());
+ mBackBtn->setEnabled(mSingleFolderPanelInventory->isBackwardAvailable());
+ mForwardBtn->setEnabled(mSingleFolderPanelInventory->isForwardAvailable());
}
if(isGalleryViewMode())
{
- getChild<LLButton>("back_btn")->setEnabled(mInventoryGalleryPanel->isBackwardAvailable());
- getChild<LLButton>("forward_btn")->setEnabled(mInventoryGalleryPanel->isForwardAvailable());
+ mBackBtn->setEnabled(mInventoryGalleryPanel->isBackwardAvailable());
+ mForwardBtn->setEnabled(mInventoryGalleryPanel->isForwardAvailable());
}
if(isCombinationViewMode())
{
- getChild<LLButton>("back_btn")->setEnabled(mCombinationInventoryPanel->isBackwardAvailable());
- getChild<LLButton>("forward_btn")->setEnabled(mCombinationInventoryPanel->isForwardAvailable());
+ mBackBtn->setEnabled(mCombinationInventoryPanel->isBackwardAvailable());
+ mForwardBtn->setEnabled(mCombinationInventoryPanel->isForwardAvailable());
}
const LLViewerInventoryCategory* cat = gInventory.getCategory(getCurrentSFVRoot());
bool up_enabled = (cat && cat->getParentUUID().notNull());
- getChild<LLButton>("up_btn")->setEnabled(up_enabled);
+ mUpBtn->setEnabled(up_enabled);
}
LLSidepanelInventory* LLPanelMainInventory::getParentSidepanelInventory()
@@ -2451,8 +2461,8 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode)
LLUUID cur_root = getCurrentSFVRoot();
mViewMode = mode;
- getChild<LLPanel>("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode());
- getChild<LLPanel>("gallery_view_inventory")->setVisible(mSingleFolderMode && isGalleryViewMode());
+ mListViewPanel->setVisible(mSingleFolderMode && isListViewMode());
+ mGalleryViewPanel->setVisible(mSingleFolderMode && isGalleryViewMode());
mCombinationScrollPanel->setVisible(mSingleFolderMode && isCombinationViewMode());
if(isListViewMode())