summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-05-31 01:09:57 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-05-31 01:09:57 +0300
commita6efb920e8e0d9add76ec86c3ed158c691685727 (patch)
tree8c76ac03fb949e81d5679406295985ea1e25aa1d
parent1834cc1a8be0b4519d774ca52202677ccaf40933 (diff)
SL-19795 Creating folders in combination mode does not scroll to new folder #2
-rw-r--r--indra/newview/llinventorygallery.cpp3
-rw-r--r--indra/newview/llpanelmaininventory.cpp16
2 files changed, 15 insertions, 4 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index c6fee42297..2f9f594790 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -183,7 +183,8 @@ void LLInventoryGallery::setRootFolder(const LLUUID cat_id)
void LLInventoryGallery::updateRootFolder()
{
- if (mIsInitialized)
+ llassert(mFolderID.notNull());
+ if (mIsInitialized && mFolderID.notNull())
{
S32 count = mItemsAddedCount;
for (S32 i = count - 1; i >= 0; i--)
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 39add4ee1c..381506c2a6 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -1011,9 +1011,12 @@ void LLPanelMainInventory::updateItemcountText()
gInventory.getDirectDescendentsOf(getCurrentSFVRoot(), cats, items);
- string_args["[ITEM_COUNT]"] = llformat("%d", items->size());
- string_args["[CATEGORY_COUNT]"] = llformat("%d", cats->size());
- text = getString("ItemcountCompleted", string_args);
+ if (items && cats)
+ {
+ string_args["[ITEM_COUNT]"] = llformat("%d", items->size());
+ string_args["[CATEGORY_COUNT]"] = llformat("%d", cats->size());
+ text = getString("ItemcountCompleted", string_args);
+ }
}
mCounterCtrl->setValue(text);
@@ -1532,6 +1535,13 @@ void LLPanelMainInventory::toggleViewMode()
}
mSingleFolderMode = !mSingleFolderMode;
+ mCombinationShapeDirty = true;
+
+ if (mCombinationGalleryPanel->getRootFolder().isNull())
+ {
+ mCombinationGalleryPanel->setRootFolder(mCombinationInventoryPanel->getSingleFolderRoot());
+ mCombinationGalleryPanel->updateRootFolder();
+ }
getChild<LLPanel>("default_inventory_panel")->setVisible(!mSingleFolderMode);
getChild<LLPanel>("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode());