diff options
author | Rye Mutt <rye@alchemyviewer.org> | 2024-08-18 15:54:15 -0400 |
---|---|---|
committer | Rye Mutt <rye@alchemyviewer.org> | 2024-08-18 15:54:15 -0400 |
commit | 4fa41c5c784c6e478d49c6641893e694aa7ed5c3 (patch) | |
tree | 6dd546888ae0c15e909f2e4275def77c701ef634 /indra | |
parent | 9827dff971807471a2c20c2342bd77c43a931e6f (diff) |
Fix findChild calls when inputting text into inventory search
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 30 | ||||
-rw-r--r-- | indra/newview/llpanelmaininventory.h | 5 |
2 files changed, 17 insertions, 18 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index fd7085c452..1a2c84af73 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -239,6 +239,11 @@ bool LLPanelMainInventory::postBuild() } } + mParentSidepanel = getParentSidepanelInventory(); + if (mParentSidepanel) + { + mInboxPanel = mParentSidepanel->getChild<LLPanelMarketplaceInbox>("marketplace_inbox"); + } mFilterEditor = getChild<LLFilterEditor>("inventory search editor"); if (mFilterEditor) @@ -761,14 +766,9 @@ void LLPanelMainInventory::onClearSearch() } mFilterSubString = ""; - LLSidepanelInventory * sidepanel_inventory = getParentSidepanelInventory(); - if (sidepanel_inventory) + if (mInboxPanel) { - LLPanelMarketplaceInbox* inbox_panel = sidepanel_inventory->getChild<LLPanelMarketplaceInbox>("marketplace_inbox"); - if (inbox_panel) - { - inbox_panel->onClearSearch(); - } + mInboxPanel->onClearSearch(); } } @@ -818,14 +818,9 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) // set new filter string setFilterSubString(mFilterSubString); - LLSidepanelInventory * sidepanel_inventory = getParentSidepanelInventory(); - if (sidepanel_inventory) + if (mInboxPanel) { - LLPanelMarketplaceInbox* inbox_panel = sidepanel_inventory->getChild<LLPanelMarketplaceInbox>("marketplace_inbox"); - if (inbox_panel) - { - inbox_panel->onFilterEdit(search_string); - } + mInboxPanel->onFilterEdit(search_string); } } @@ -1578,16 +1573,15 @@ void LLPanelMainInventory::toggleViewMode() updateTitle(); onFilterSelected(); - LLSidepanelInventory* sidepanel_inventory = getParentSidepanelInventory(); - if (sidepanel_inventory) + if (mParentSidepanel) { if(mSingleFolderMode) { - sidepanel_inventory->hideInbox(); + mParentSidepanel->hideInbox(); } else { - sidepanel_inventory->toggleInbox(); + mParentSidepanel->toggleInbox(); } } } diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 68ac3410d8..c1c7e9a7ab 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -49,6 +49,8 @@ class LLSidepanelInventory; class LLToggleableMenu; class LLFloater; class LLFloaterSidePanelContainer; +class LLSidepanelInventory; +class LLPanelMarketplaceInbox; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLPanelMainInventory @@ -244,6 +246,9 @@ protected: void setUploadCostIfNeeded(); void disableAddIfNeeded(); private: + LLSidepanelInventory* mParentSidepanel = nullptr; + LLPanelMarketplaceInbox* mInboxPanel = nullptr; + LLToggleableMenu* mMenuGearDefault; LLToggleableMenu* mMenuViewDefault; LLToggleableMenu* mMenuVisibility; |