diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-05-24 22:51:02 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-05-25 02:18:50 +0300 |
commit | 572e8269bcd5320daa66f4074e927c79869bf7de (patch) | |
tree | 92c4bdbb5dd9280e3079243826bd952d9fec7cd9 /indra/newview/llpanelmaininventory.cpp | |
parent | 505c15cf47c04e45f4a68790b5c63237a7bfcc9b (diff) |
SL-19604 Creating new folders in combination views does not highlight created item
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 5a8565b5aa..998a211795 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -256,7 +256,7 @@ BOOL LLPanelMainInventory::postBuild() mInventoryGalleryPanel = getChild<LLInventoryGallery>("gallery_view_inv"); mGalleryRootUpdatedConnection = mInventoryGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); - mCombinationScrollPanel = getChild<LLUICtrl>("combination_view_inventory"); + mCombinationScrollPanel = getChild<LLScrollContainer>("combination_view_inventory"); mCombinationInventoryPanel = getChild<LLInventorySingleFolderPanel>("comb_single_folder_inv"); LLInventoryFilter& comb_inv_filter = mCombinationInventoryPanel->getFilter(); @@ -264,6 +264,7 @@ BOOL LLPanelMainInventory::postBuild() comb_inv_filter.markDefault(); mCombinationInventoryPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onCombinationInventorySelectionChanged, this, _1, _2)); mCombinationInventoryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, false)); + mCombinationInventoryPanel->setScroller(mCombinationScrollPanel); mCombinationGalleryPanel = getChild<LLInventoryGallery>("comb_gallery_view_inv"); LLInventoryFilter& comb_gallery_filter = mCombinationGalleryPanel->getFilter(); @@ -2326,6 +2327,11 @@ void LLPanelMainInventory::updateCombinationVisibility() { mCombinationShapeDirty = false; mCombinationInventoryPanel->reshape(1,1); // HACK: force reduce visible area + LLFolderView* root_folder = mCombinationInventoryPanel->getRootFolder(); + if (root_folder) + { + root_folder->arrangeAll(); + } } if (!mCombinationGalleryPanel->hasVisibleItems()) { @@ -2335,13 +2341,11 @@ void LLPanelMainInventory::updateCombinationVisibility() LLRect inv_inner_rect = mCombinationInventoryPanel->getScrollableContainer()->getScrolledViewRect(); LLRect galery_rect = mCombinationGalleryPanel->getRect(); LLRect inner_galery_rect = mCombinationGalleryPanel->getScrollableContainer()->getScrolledViewRect(); - LLScrollContainer* scroll = static_cast<LLScrollContainer*>(mCombinationScrollPanel); - LLRect scroller_window_rect = scroll->getContentWindowRect(); + LLRect scroller_window_rect = mCombinationScrollPanel->getContentWindowRect(); const S32 BORDER_PAD = 2; // two sides - S32 desired_width = llmax(inv_inner_rect.getWidth(), scroller_window_rect.getWidth() - BORDER_PAD); inv_rect.mBottom = 0; - inv_rect.mRight = inv_rect.mLeft + desired_width; + inv_rect.mRight = inv_rect.mLeft + inv_inner_rect.getWidth(); if (!mCombinationGalleryPanel->hasVisibleItems() || mCombinationInventoryPanel->hasVisibleItems()) { inv_rect.mTop = inv_rect.mBottom + inv_inner_rect.getHeight() + BORDER_PAD; @@ -2364,7 +2368,7 @@ void LLPanelMainInventory::updateCombinationVisibility() galery_rect.mTop = galery_rect.mBottom; } - mCombinationScroller->reshape(desired_width, inv_rect.getHeight() + galery_rect.getHeight(), true); + mCombinationScroller->reshape(scroller_window_rect.getWidth(), inv_rect.getHeight() + galery_rect.getHeight(), true); mCombinationGalleryPanel->setShape(galery_rect, false); mCombinationInventoryPanel->setShape(inv_rect, false); @@ -2376,12 +2380,6 @@ void LLPanelMainInventory::updateCombinationVisibility() { scrollToInvPanelSelection(); } - - LLFolderView* root_folder = mCombinationInventoryPanel->getRootFolder(); - if (root_folder) - { - root_folder->updateRenamerPosition(); - } } } |