summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmaininventory.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-06-06 21:44:46 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-06-06 21:45:16 +0300
commitd5c1d6c24559ce44c7ab6e1249c50bcb04105e5f (patch)
tree7e23adfbc94f371d57c2c48cf0ec43cdee6903f0 /indra/newview/llpanelmaininventory.cpp
parent2281377c347233b79f76249143e6197142efcfbb (diff)
SL-19823 Edit not always active when adding items and folders in single folder view
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r--indra/newview/llpanelmaininventory.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 0ad4e69942..9892360a1b 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -515,16 +515,15 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata)
mForceShowInvLayout = true;
}
- LLHandle<LLPanel> handle = mCombinationInventoryPanel->getHandle();
+ LLHandle<LLPanel> handle = getHandle();
std::function<void(const LLUUID&)> callback_cat_created = [handle](const LLUUID& new_category_id)
{
gInventory.notifyObservers(); // not really needed, should have been already done
- LLInventorySingleFolderPanel* panel = (LLInventorySingleFolderPanel*)handle.get();
+ LLPanelMainInventory* panel = (LLPanelMainInventory*)handle.get();
if (new_category_id.notNull() && panel)
{
- panel->setSelectionByID(new_category_id, TRUE);
- panel->getRootFolder()->scrollToShowSelection();
- panel->getRootFolder()->setNeedsAutoRename(TRUE);
+ // might need to refresh visibility, delay rename
+ panel->mCombInvUUIDNeedsRename = new_category_id;
}
};
menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata, LLUUID::null, callback_cat_created);
@@ -532,12 +531,17 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata)
}
else
{
- std::function<void(const LLUUID&)> callback_cat_created = [this](const LLUUID &new_category_id)
+ LLHandle<LLPanel> handle = getHandle();
+ std::function<void(const LLUUID&)> callback_cat_created = [handle](const LLUUID &new_category_id)
{
gInventory.notifyObservers(); // not really needed, should have been already done
if (new_category_id.notNull())
{
- setGallerySelection(new_category_id);
+ LLPanelMainInventory* panel = (LLPanelMainInventory*)handle.get();
+ if (panel)
+ {
+ panel->setGallerySelection(new_category_id);
+ }
}
};
menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata, LLUUID::null, callback_cat_created);
@@ -2414,6 +2418,14 @@ void LLPanelMainInventory::updateCombinationVisibility()
mCombinationListLayoutPanel->setShape(list_latout, true /*tell stack to account for new shape*/);
}
}
+
+ if (mCombInvUUIDNeedsRename.notNull() && !mReshapeInvLayout)
+ {
+ mCombinationInventoryPanel->setSelectionByID(mCombInvUUIDNeedsRename, TRUE);
+ mCombinationInventoryPanel->getRootFolder()->scrollToShowSelection();
+ mCombinationInventoryPanel->getRootFolder()->setNeedsAutoRename(TRUE);
+ mCombInvUUIDNeedsRename.setNull();
+ }
}
}