diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 5e0985c79c..48e42d9fc0 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) const +{ + 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 4ac7e73d25..cbf56dc653 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) const; void startDragAndDropDelayTimer() { mDragAndDropDelayTimer.start(); } diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f353d5fad9..1b5cf7b145 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 ad7aa57842..04eebcefc1 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)); @@ -1613,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() @@ -2056,6 +2062,27 @@ 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); + 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") + { + bool visibility = !gSavedSettings.getBOOL("InventoryShowFavoritesTab"); + gSavedSettings.setBOOL("InventoryShowFavoritesTab", visibility); + mFilterTabs->setTabVisibility(mFavoritesPanel, visibility); + } } void LLPanelMainInventory::onVisibilityChange( bool new_visibility ) @@ -2283,6 +2310,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 a78c0c0fad..03650e7fc1 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 97f53d3a17..f85f897700 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" /> - - - + + + + + + + + + + + + + + + +