From 76eacbdc43afff94d54292ac3b5466e17024c386 Mon Sep 17 00:00:00 2001 From: TighMacFanatic Date: Thu, 6 Oct 2011 12:55:30 -0400 Subject: [PATCH] Added collapse all button to inventory window. --- indra/newview/llinventoryview.cpp | 14 ++++++++++++++ indra/newview/llinventoryview.h | 1 + .../skins/default/xui/en-us/floater_inventory.xml | 9 ++++++--- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/indra/newview/llinventoryview.cpp b/indra/newview/llinventoryview.cpp index ec1cab830..8edef568b 100644 --- a/indra/newview/llinventoryview.cpp +++ b/indra/newview/llinventoryview.cpp @@ -588,6 +588,7 @@ BOOL LLInventoryView::postBuild() childSetAction("Inventory.ResetAll",onResetAll,this); childSetAction("Inventory.ExpandAll",onExpandAll,this); + childSetAction("collapse_btn", onCollapseAll, this); //panel->getFilter()->markDefault(); return TRUE; @@ -1354,6 +1355,19 @@ void LLInventoryView::onExpandAll(void* userdata) } +//static +void LLInventoryView::onCollapseAll(void* userdata) +{ + LLInventoryView* self = (LLInventoryView*) userdata; + self->mActivePanel = (LLInventoryPanel*)self->childGetVisibleTab("inventory filter tabs"); + + if (!self->mActivePanel) + { + return; + } + self->mActivePanel->closeAllFolders(); +} + //static void LLInventoryView::onFilterSelected(void* userdata, bool from_click) { diff --git a/indra/newview/llinventoryview.h b/indra/newview/llinventoryview.h index d9c8e4c07..492e79d33 100644 --- a/indra/newview/llinventoryview.h +++ b/indra/newview/llinventoryview.h @@ -282,6 +282,7 @@ public: static void onFilterSelected(void* userdata, bool from_click); static void onResetAll(void* userdata); static void onExpandAll(void* userdata); + static void onCollapseAll(void* userdata); static void onSelectionChange(const std::deque &items, BOOL user_action, void* data); const std::string getFilterSubString() { return mActivePanel->getFilterSubString(); } diff --git a/indra/newview/skins/default/xui/en-us/floater_inventory.xml b/indra/newview/skins/default/xui/en-us/floater_inventory.xml index d42d855d6..457ae4b3f 100644 --- a/indra/newview/skins/default/xui/en-us/floater_inventory.xml +++ b/indra/newview/skins/default/xui/en-us/floater_inventory.xml @@ -5,8 +5,11 @@ title="Inventory" width="467"> - Quick Filter: +