From 261e728327ce72bc582f41cbb231035f0ee1f9b1 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 28 Feb 2014 02:08:29 +0000 Subject: Made lists only visible when populated in Friends tab in Facebook floater for ACME-1334 --- indra/newview/llfloaterfacebook.cpp | 20 +++++++++++++++++++- indra/newview/llfloaterfacebook.h | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp index 6c2c2428c5..4e6dd002ed 100644 --- a/indra/newview/llfloaterfacebook.cpp +++ b/indra/newview/llfloaterfacebook.cpp @@ -51,6 +51,8 @@ #include "lltabcontainer.h" #include "llavatarlist.h" #include "llpanelpeoplemenus.h" +#include "llaccordionctrl.h" +#include "llaccordionctrltab.h" static LLRegisterPanelClassWrapper t_panel_status("llfacebookstatuspanel"); static LLRegisterPanelClassWrapper t_panel_photo("llfacebookphotopanel"); @@ -799,11 +801,27 @@ bool LLFacebookFriendsPanel::updateSuggestedFriendList() //Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display) mSecondLifeFriends->setDirty(true, !mSecondLifeFriends->filterHasMatches()); mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches()); - //showFriendsAccordionsIfNeeded(); + showFriendsAccordionsIfNeeded(); return false; } +void LLFacebookFriendsPanel::showFriendsAccordionsIfNeeded() +{ + // Expand and show accordions if needed, else - hide them + getChild("tab_second_life_friends")->setVisible(mSecondLifeFriends->filterHasMatches()); + getChild("tab_suggested_friends")->setVisible(mSuggestedFriends->filterHasMatches()); + + // Rearrange accordions + LLAccordionCtrl* accordion = getChild("friends_accordion"); + accordion->arrange(); + + // *TODO: new no_matched_tabs_text attribute was implemented in accordion (EXT-7368). + // this code should be refactored to use it + // keep help text in a synchronization with accordions visibility. + //updateFriendListHelpText(); +} + void LLFacebookFriendsPanel::updateFacebookList(bool visible) { if (visible) diff --git a/indra/newview/llfloaterfacebook.h b/indra/newview/llfloaterfacebook.h index c13d64a86a..16c9e97ff0 100644 --- a/indra/newview/llfloaterfacebook.h +++ b/indra/newview/llfloaterfacebook.h @@ -136,6 +136,7 @@ public: private: bool updateSuggestedFriendList(); + void showFriendsAccordionsIfNeeded(); void updateFacebookList(bool visible); bool onConnectedToFacebook(const LLSD& data); -- cgit v1.2.3