From 0d5b8358401bc62feae5cbfad002dd4378bfe4a6 Mon Sep 17 00:00:00 2001
From: pavelkproductengine <pavelkproductengine@lindenlab.com>
Date: Thu, 20 Apr 2017 16:55:14 +0300
Subject: [PATCH] MAINT-6477 VOB - Click on an outfit folder from Outfit
 Gallery tab does not open folder or enlarge image

---
 indra/newview/lloutfitgallery.cpp | 30 ++++++++++++++++++++++++++++++
 indra/newview/lloutfitgallery.h   |  3 +++
 indra/newview/lloutfitslist.cpp   |  2 +-
 3 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp
index eeeb7e5c256..31e89c0ed02 100644
--- a/indra/newview/lloutfitgallery.cpp
+++ b/indra/newview/lloutfitgallery.cpp
@@ -34,6 +34,7 @@
 #include "llcommonutils.h"
 #include "llvfile.h"
 
+#include "llaccordionctrltab.h"
 #include "llappearancemgr.h"
 #include "lleconomy.h"
 #include "llerror.h"
@@ -46,6 +47,8 @@
 #include "llinventorymodel.h"
 #include "lllocalbitmaps.h"
 #include "llnotificationsutil.h"
+#include "llpaneloutfitsinventory.h"
+#include "lltabcontainer.h"
 #include "lltexturectrl.h"
 #include "lltrans.h"
 #include "llviewercontrol.h"
@@ -742,6 +745,33 @@ BOOL LLOutfitGalleryItem::handleRightMouseDown(S32 x, S32 y, MASK mask)
     return LLUICtrl::handleRightMouseDown(x, y, mask);
 }
 
+BOOL LLOutfitGallery::handleDoubleClick(S32 x, S32 y, MASK mask)
+{
+    LLTabContainer* appearence_tabs = LLPanelOutfitsInventory::findInstance()->getChild<LLTabContainer>("appearance_tabs");
+    LLPanel* panel = NULL;
+    LLAccordionCtrl* accordion = NULL;
+    if (appearence_tabs != NULL)
+    {
+        appearence_tabs->selectTabByName("outfitslist_tab");
+        panel = appearence_tabs->getCurrentPanel();
+        if (panel != NULL)
+        {
+            accordion = panel->getChild<LLAccordionCtrl>("outfits_accordion");
+            LLOutfitsList* outfit_list = dynamic_cast<LLOutfitsList*>(panel);
+            if (accordion != NULL && outfit_list != NULL)
+            {
+                LLUUID item_id = getSelectedOutfitUUID();
+                outfit_list->setSelectedOutfitByUUID(item_id);
+                LLAccordionCtrlTab* tab = accordion->getSelectedTab();
+                tab->showAndFocusHeader();
+                return TRUE;
+            }
+        }
+    }
+
+	return LLUICtrl::handleDoubleClick(x, y, mask);
+}
+
 void LLOutfitGalleryItem::setImageAssetId(LLUUID image_asset_id)
 {
     mImageAssetId = image_asset_id;
diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h
index b9fc10f015a..37e75f11095 100644
--- a/indra/newview/lloutfitgallery.h
+++ b/indra/newview/lloutfitgallery.h
@@ -114,6 +114,9 @@ class LLOutfitGallery : public LLOutfitListBase
     void onTexturePickerUpdateImageStats(LLPointer<LLViewerTexture> texture);
     void onBeforeOutfitSnapshotSave();
     void onAfterOutfitSnapshotSave();
+
+    /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
+
 protected:
     /*virtual*/ void onHighlightBaseOutfit(LLUUID base_id, LLUUID prev_id);
     /*virtual*/ void onSetSelectedOutfitByUUID(const LLUUID& outfit_uuid);
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp
index e1f51e62e3b..f87ce8aa52e 100644
--- a/indra/newview/lloutfitslist.cpp
+++ b/indra/newview/lloutfitslist.cpp
@@ -311,7 +311,7 @@ void LLOutfitsList::onSetSelectedOutfitByUUID(const LLUUID& outfit_uuid)
 			tab->setFocus(TRUE);
 			ChangeOutfitSelection(list, outfit_uuid);
 
-			tab->setDisplayChildren(true);
+			tab->changeOpenClose(false);
 		}
 	}
 }
-- 
GitLab