From 1e4ebffa0c801b41990ab38c85ef95eb6f948cd5 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 19 Apr 2023 17:09:39 +0300 Subject: SL-19604 show layout panel before creating new item in combination mode, if there are no items in inventory panel --- indra/newview/llpanelmaininventory.cpp | 17 ++++++++++++++--- indra/newview/llpanelmaininventory.h | 2 ++ 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 9d1e861344..d8845a7d94 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -118,6 +118,7 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mNeedUploadCost(true), mMenuViewDefault(NULL), mSingleFolderMode(false), + mForceShowInvLayout(false), mViewMode(MODE_LIST), mListViewRootUpdatedConnection(), mGalleryRootUpdatedConnection() @@ -502,6 +503,13 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) LLFolderViewItem* current_folder = getActivePanel()->getRootFolder(); if (current_folder) { + if(isCombinationViewMode()) + { + //show layout and inventory panel before adding the item + //to avoid wrong position of the 'renamer' + mForceShowInvLayout = true; + } + LLFolderBridge* bridge = (LLFolderBridge*)current_folder->getViewModelItem(); menu_create_inventory_item(getPanel(), bridge, userdata); } @@ -2198,7 +2206,7 @@ void LLPanelMainInventory::onCombinationRootChanged(bool gallery_clicked) { mCombinationGalleryPanel->setRootFolder(mCombinationInventoryPanel->getSingleFolderRoot()); } - + mForceShowInvLayout = false; updateTitle(); } @@ -2207,11 +2215,14 @@ void LLPanelMainInventory::updateCombinationVisibility() if(mSingleFolderMode && isCombinationViewMode()) { bool is_gallery_empty = !mCombinationGalleryPanel->hasVisibleItems(); - bool show_inv_pane = mCombinationInventoryPanel->hasVisibleItems() || is_gallery_empty; + bool show_inv_pane = mCombinationInventoryPanel->hasVisibleItems() || is_gallery_empty || mForceShowInvLayout; getChild("comb_gallery_layout")->setVisible(!is_gallery_empty); getChild("comb_inventory_layout")->setVisible(show_inv_pane); mCombinationInventoryPanel->getRootFolder()->setForceArrange(!show_inv_pane); - + if(mCombinationInventoryPanel->hasVisibleItems()) + { + mForceShowInvLayout = false; + } if(is_gallery_empty) { mCombinationGalleryPanel->handleModifiedFilter(); diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 8bc8f4e2e6..e5b9ba929d 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -231,6 +231,8 @@ private: LLHandle mMenuAddHandle; bool mNeedUploadCost; + + bool mForceShowInvLayout; // List Commands // //////////////////////////////////////////////////////////////////////////////// }; -- cgit v1.2.3