summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmaininventory.cpp
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-05-05 18:17:00 +0300
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-05-05 18:17:00 +0300
commit61818417d619c8d17cf861f0d72b314a14269e2f (patch)
treec8f162d81791c621e38d40cebf50275933837d4b /indra/newview/llpanelmaininventory.cpp
parent98681ef73ff33e0c0ff321e839a8e79b2cb334de (diff)
SL-19641 FIXED Gallery item is not selected after using 'Find original'
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r--indra/newview/llpanelmaininventory.cpp70
1 files changed, 64 insertions, 6 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index b0422b7bd9..2f6276ff77 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -122,7 +122,9 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p)
mViewMode(MODE_COMBINATION),
mCombinationShapeDirty(true),
mListViewRootUpdatedConnection(),
- mGalleryRootUpdatedConnection()
+ mGalleryRootUpdatedConnection(),
+ mDelayedCombGalleryScroll(false),
+ mDelayedCombInvPanelScroll(false)
{
// Menu Callbacks (non contex menus)
mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLPanelMainInventory::doToSelected, this, _2));
@@ -466,7 +468,7 @@ void LLPanelMainInventory::newFolderWindow(LLUUID folder_id, LLUUID item_to_sele
main_inventory->setFocus(true);
if(item_to_select.notNull())
{
- sidepanel_inventory->getActivePanel()->setSelection(item_to_select, TAKE_FOCUS_YES);
+ main_inventory->setGallerySelection(item_to_select);
}
return;
}
@@ -491,7 +493,7 @@ void LLPanelMainInventory::newFolderWindow(LLUUID folder_id, LLUUID item_to_sele
main_inventory->setSingleFolderViewRoot(folder_id);
if(item_to_select.notNull())
{
- sidepanel_inventory->getActivePanel()->setSelection(item_to_select, TAKE_FOCUS_YES);
+ main_inventory->setGallerySelection(item_to_select, true);
}
}
}
@@ -2345,6 +2347,15 @@ void LLPanelMainInventory::updateCombinationVisibility()
mCombinationScroller->reshape(desired_width, inv_rect.getHeight() + galery_rect.getHeight(), true);
mCombinationGalleryPanel->setShape(galery_rect, false);
mCombinationInventoryPanel->setShape(inv_rect, false);
+
+ if(mDelayedCombGalleryScroll)
+ {
+ scrollToGallerySelection();
+ }
+ else if(mDelayedCombInvPanelScroll)
+ {
+ scrollToInvPanelSelection();
+ }
}
}
@@ -2478,7 +2489,7 @@ LLInventoryFilter& LLPanelMainInventory::getCurrentFilter()
}
}
-void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id)
+void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id, bool new_window)
{
if(mSingleFolderMode && isGalleryViewMode())
{
@@ -2488,13 +2499,60 @@ void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id)
{
if(mCombinationGalleryPanel->getFilter().checkAgainstFilterThumbnails(item_id))
{
- mCombinationGalleryPanel->changeItemSelection(item_id, true);
+ mCombinationGalleryPanel->changeItemSelection(item_id, false);
+ if(new_window)
+ {
+ mDelayedCombGalleryScroll = new_window;
+ }
+ else
+ {
+ scrollToGallerySelection();
+ }
}
else
{
- mCombinationInventoryPanel->setSelection(item_id, false);
+ mCombinationInventoryPanel->setSelection(item_id, true);
+ if(new_window)
+ {
+ mDelayedCombInvPanelScroll = new_window;
+ }
+ else
+ {
+ scrollToInvPanelSelection();
+ }
}
}
+ else if (mSingleFolderMode && isListViewMode())
+ {
+ mSingleFolderPanelInventory->setSelection(item_id, true);
+ }
+}
+
+void LLPanelMainInventory::scrollToGallerySelection()
+{
+ LLInventoryGalleryItem* item = mCombinationGalleryPanel->getSelectedItem();
+ LLScrollContainer* scroll_panel = getChild<LLScrollContainer>("combination_view_inventory");
+
+ if(item)
+ {
+ LLRect item_rect;
+ item->localRectToOtherView(item->getLocalRect(), &item_rect, mCombinationScroller);
+ scroll_panel->scrollToShowRect(item_rect);
+ }
}
+
+void LLPanelMainInventory::scrollToInvPanelSelection()
+{
+ LLFolderViewItem* item = mCombinationInventoryPanel->getRootFolder()->getCurSelectedItem();
+ LLScrollContainer* scroll_panel = getChild<LLScrollContainer>("combination_view_inventory");
+
+ if(item)
+ {
+ LLRect item_rect;
+ item->localRectToOtherView(item->getLocalRect(), &item_rect, mCombinationScroller);
+ scroll_panel->scrollToShowRect(item_rect);
+ }
+}
+
// List Commands //
////////////////////////////////////////////////////////////////////////////////