From 63675a03d469ee17b8758917cf45f2f82c09575b Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 20 Feb 2026 13:19:19 +0200 Subject: [PATCH 1/2] #5396 Add an option to hide Recent, Worn and Favorites tabs --- indra/llui/lltabcontainer.cpp | 13 +++++ indra/llui/lltabcontainer.h | 1 + indra/newview/app_settings/settings.xml | 33 +++++++++++++ indra/newview/llpanelmaininventory.cpp | 46 ++++++++++++++++-- indra/newview/llpanelmaininventory.h | 1 + .../xui/en/menu_inventory_view_default.xml | 48 +++++++++++++++++-- 6 files changed, 132 insertions(+), 10 deletions(-) diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 5e0985c79cf..fd30fbc860d 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -2202,3 +2202,16 @@ void LLTabContainer::setTabVisibility( LLPanel const *aPanel, bool aVisible ) updateMaxScrollPos(); } + +bool LLTabContainer::getTabVisibility(const LLPanel* panel) +{ + for (tuple_list_t::const_iterator itr = mTabList.begin(); itr != mTabList.end(); ++itr) + { + LLTabTuple const* pTT = *itr; + if (pTT->mTabPanel == panel) + { + return pTT->mVisible; + } + } + return false; +} diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index 4ac7e73d259..5a178f92d72 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -225,6 +225,7 @@ class LLTabContainer : public LLPanel S32 getMaxTabWidth() const { return mMaxTabWidth; } void setTabVisibility( LLPanel const *aPanel, bool ); + bool getTabVisibility(const LLPanel* panel); void startDragAndDropDelayTimer() { mDragAndDropDelayTimer.start(); } diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f353d5fad92..1b5cf7b1451 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16431,6 +16431,39 @@ Value 0 + InventoryShowRecentTab + + Comment + Show/hide Recent tab in the Inventory floater + Persist + 1 + Type + Boolean + Value + 1 + + InventoryShowWornTab + + Comment + Show/hide Worn tab in the Inventory floater + Persist + 1 + Type + Boolean + Value + 1 + + InventoryShowFavoritesTab + + Comment + Show/hide Favorites tab in the Inventory floater + Persist + 1 + Type + Boolean + Value + 1 + StatsReportMaxDuration Comment diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index ad7aa57842f..01f8efb8c86 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -216,14 +216,14 @@ bool LLPanelMainInventory::postBuild() mWornItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mWornItemsPanel, _1, _2)); } - LLInventoryPanel* favorites_panel = getChild(FAVORITES); - if (favorites_panel) + mFavoritesPanel = getChild(FAVORITES); + if (mFavoritesPanel) { - favorites_panel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER)); - LLInventoryFilter& favorites_filter = favorites_panel->getFilter(); + mFavoritesPanel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER)); + LLInventoryFilter& favorites_filter = mFavoritesPanel->getFilter(); favorites_filter.setEmptyLookupMessage("InventoryNoMatchingFavorites"); favorites_filter.markDefault(); - favorites_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, favorites_panel, _1, _2)); + mFavoritesPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mFavoritesPanel, _1, _2)); } mSearchTypeCombo = getChild("search_type"); @@ -319,6 +319,10 @@ bool LLPanelMainInventory::postBuild() menu->getChild("Upload Animation")->setLabelArg("[COST]", animation_upload_cost_str); } + mFilterTabs->setTabVisibility(mRecentPanel, gSavedSettings.getBOOL("InventoryShowRecentTab")); + mFilterTabs->setTabVisibility(mWornItemsPanel, gSavedSettings.getBOOL("InventoryShowWornTab")); + mFilterTabs->setTabVisibility(mFavoritesPanel, gSavedSettings.getBOOL("InventoryShowFavoritesTab")); + // Trigger callback for focus received so we can deselect items in inbox/outbox LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMainInventory::onFocusReceived, this)); @@ -2056,6 +2060,25 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) { setViewMode(MODE_COMBINATION); } + + if (command_name == "toggle_recent_tab") + { + bool visibility = !gSavedSettings.getBOOL("InventoryShowRecentTab"); + gSavedSettings.setBOOL("InventoryShowRecentTab", visibility); + mFilterTabs->setTabVisibility(mRecentPanel, visibility); + } + if (command_name == "toggle_worn_tab") + { + bool visibility = !gSavedSettings.getBOOL("InventoryShowWornTab"); + gSavedSettings.setBOOL("InventoryShowWornTab", visibility); + mFilterTabs->setTabVisibility(mWornItemsPanel, visibility); + } + if (command_name == "toggle_favorites_tab") + { + bool visibility = !gSavedSettings.getBOOL("InventoryShowFavoritesTab"); + gSavedSettings.setBOOL("InventoryShowFavoritesTab", visibility); + mFilterTabs->setTabVisibility(mFavoritesPanel, visibility); + } } void LLPanelMainInventory::onVisibilityChange( bool new_visibility ) @@ -2283,6 +2306,19 @@ bool LLPanelMainInventory::isActionChecked(const LLSD& userdata) return isCombinationViewMode(); } + if (command_name == "recent_tab") + { + return mFilterTabs->getTabVisibility(mRecentPanel); + } + if (command_name == "worn_tab") + { + return mFilterTabs->getTabVisibility(mWornItemsPanel); + } + if (command_name == "favorites_tab") + { + return mFilterTabs->getTabVisibility(mFavoritesPanel); + } + return false; } diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index a78c0c0fad0..03650e7fc19 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -199,6 +199,7 @@ class LLPanelMainInventory : public LLPanel, LLInventoryObserver LLInventoryPanel* mAllItemsPanel = nullptr; LLInventoryPanel* mRecentPanel = nullptr; LLInventoryPanel* mWornItemsPanel = nullptr; + LLInventoryPanel* mFavoritesPanel = nullptr; bool mResortActivePanel; LLSaveFolderState* mSavedFolderState; std::string mFilterText; diff --git a/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml b/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml index 97f53d3a17a..f85f897700b 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml @@ -53,11 +53,7 @@ function="Inventory.GearDefault.Visible" parameter="multi_folder_view" /> - - - + + + + + + + + + + + + + + + + From ae3cf7c6b87bf2ca57fb21151f326a0dc5e2067f Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 20 Feb 2026 16:51:19 +0200 Subject: [PATCH 2/2] #5396 skip tabs initialization if hidden --- indra/llui/lltabcontainer.cpp | 2 +- indra/llui/lltabcontainer.h | 2 +- indra/newview/llpanelmaininventory.cpp | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index fd30fbc860d..48e42d9fc02 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -2203,7 +2203,7 @@ void LLTabContainer::setTabVisibility( LLPanel const *aPanel, bool aVisible ) updateMaxScrollPos(); } -bool LLTabContainer::getTabVisibility(const LLPanel* panel) +bool LLTabContainer::getTabVisibility(const LLPanel* panel) const { for (tuple_list_t::const_iterator itr = mTabList.begin(); itr != mTabList.end(); ++itr) { diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index 5a178f92d72..cbf56dc653b 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -225,7 +225,7 @@ class LLTabContainer : public LLPanel S32 getMaxTabWidth() const { return mMaxTabWidth; } void setTabVisibility( LLPanel const *aPanel, bool ); - bool getTabVisibility(const LLPanel* panel); + bool getTabVisibility(const LLPanel* panel) const; void startDragAndDropDelayTimer() { mDragAndDropDelayTimer.start(); } diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 01f8efb8c86..04eebcefc14 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1617,8 +1617,10 @@ void LLPanelMainInventory::initSingleFolderRoot(const LLUUID& start_folder_id) void LLPanelMainInventory::initInventoryViews() { mAllItemsPanel->initializeViewBuilding(); - mRecentPanel->initializeViewBuilding(); - mWornItemsPanel->initializeViewBuilding(); + if (gSavedSettings.getBOOL("InventoryShowRecentTab")) + mRecentPanel->initializeViewBuilding(); + if (gSavedSettings.getBOOL("InventoryShowWornTab")) + mWornItemsPanel->initializeViewBuilding(); } void LLPanelMainInventory::toggleViewMode() @@ -2066,12 +2068,14 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) bool visibility = !gSavedSettings.getBOOL("InventoryShowRecentTab"); gSavedSettings.setBOOL("InventoryShowRecentTab", visibility); mFilterTabs->setTabVisibility(mRecentPanel, visibility); + mRecentPanel->initializeViewBuilding(); } if (command_name == "toggle_worn_tab") { bool visibility = !gSavedSettings.getBOOL("InventoryShowWornTab"); gSavedSettings.setBOOL("InventoryShowWornTab", visibility); mFilterTabs->setTabVisibility(mWornItemsPanel, visibility); + mWornItemsPanel->initializeViewBuilding(); } if (command_name == "toggle_favorites_tab") {