From ff37134a405e81899b4d9e7d07be7e3da85c8278 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Mon, 26 Oct 2009 19:30:46 +0200 Subject: Implemented low task EXT-1156(Implement option to show/hide avatar icon in the friend list) --HG-- branch : product-engine --- indra/newview/llavatarlist.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'indra/newview/llavatarlist.cpp') diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 3a07c6e5ef..1d07caee53 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -38,6 +38,7 @@ #include "llcallingcard.h" // for LLAvatarTracker #include "llcachename.h" #include "llvoiceclient.h" +#include "llviewercontrol.h" // for gSavedSettings static LLDefaultChildRegistry::Register r("avatar_list"); @@ -45,6 +46,21 @@ static LLDefaultChildRegistry::Register r("avatar_list"); // Used to limit time spent for avatar list update per frame. static const unsigned ADD_LIMIT = 50; +void LLAvatarList::toggleIcons() +{ + // Save the new value for new items to use. + mShowIcons = !mShowIcons; + gSavedSettings.setBOOL(mIconParamName, mShowIcons); + + // Show/hide icons for all existing items. + std::vector items; + getItems(items); + for( std::vector::const_iterator it = items.begin(); it != items.end(); it++) + { + static_cast(*it)->setAvatarIconVisible(mShowIcons); + } +} + static bool findInsensitive(std::string haystack, const std::string& needle_upper) { LLStringUtil::toUpper(haystack); @@ -73,6 +89,12 @@ LLAvatarList::LLAvatarList(const Params& p) setComparator(&NAME_COMPARATOR); } +void LLAvatarList::setShowIcons(std::string param_name) +{ + mIconParamName= param_name; + mShowIcons = gSavedSettings.getBOOL(mIconParamName); +} + // virtual void LLAvatarList::draw() { @@ -202,6 +224,7 @@ void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is item->setContextMenu(mContextMenu); item->childSetVisible("info_btn", false); + item->setAvatarIconVisible(mShowIcons); addItem(item, id, pos); } -- cgit v1.2.3 From ae4c4a18a141435e9b13dc4b0b110b4f031b337d Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Wed, 28 Oct 2009 17:49:32 +0200 Subject: Fixed normal bug EXT-1164 - FlatList isn't reshaped on filtering when accordion panels are collpased. --HG-- branch : product-engine --- indra/newview/llavatarlist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llavatarlist.cpp') diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 1d07caee53..0fc613abec 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -98,10 +98,10 @@ void LLAvatarList::setShowIcons(std::string param_name) // virtual void LLAvatarList::draw() { + LLFlatListView::draw(); + if (mDirty) refresh(); - - LLFlatListView::draw(); } void LLAvatarList::setNameFilter(const std::string& filter) -- cgit v1.2.3 From e2a15bc7b8ce60cf2a62aae621184eb26560a9a3 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Wed, 28 Oct 2009 17:55:24 +0200 Subject: Added comment --HG-- branch : product-engine --- indra/newview/llavatarlist.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llavatarlist.cpp') diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 0fc613abec..e93d0dfa50 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -98,6 +98,9 @@ void LLAvatarList::setShowIcons(std::string param_name) // virtual void LLAvatarList::draw() { + // *NOTE dzaporozhan + // Call refresh() after draw() to avoid flickering of avatar list items. + LLFlatListView::draw(); if (mDirty) -- cgit v1.2.3