SL-19823 Edit not always active when adding items and folders in single folder view

master
Andrey Kleshchev 2023-06-06 21:44:46 +03:00
parent 2281377c34
commit d5c1d6c245
2 changed files with 20 additions and 7 deletions

View File

@ -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();
}
}
}

View File

@ -250,6 +250,7 @@ private:
bool mForceShowInvLayout;
bool mReshapeInvLayout;
LLUUID mCombInvUUIDNeedsRename;
// List Commands //
////////////////////////////////////////////////////////////////////////////////
};