diff options
| author | Eric M. Tulla (BigPapi) <tulla@lindenlab.com> | 2009-10-29 12:49:06 -0400 |
|---|---|---|
| committer | Eric M. Tulla (BigPapi) <tulla@lindenlab.com> | 2009-10-29 12:49:06 -0400 |
| commit | fb4e95f7ea0a1f6e900f6ee1de73ec02860ff815 (patch) | |
| tree | 96be2590ce94939aaae841c8a36429102f2afca9 /indra/newview/llavatarlist.cpp | |
| parent | 1f0896c72a71797fcd924de1aab63ab5a5c893f9 (diff) | |
| parent | 64c2cb6ba1c089c15df6c8ef5ec5313ed5f1897f (diff) | |
Merge after pull from viewer 2.0 changes
Diffstat (limited to 'indra/newview/llavatarlist.cpp')
| -rw-r--r-- | indra/newview/llavatarlist.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 3a07c6e5ef..e93d0dfa50 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<LLAvatarList> r("avatar_list"); @@ -45,6 +46,21 @@ static LLDefaultChildRegistry::Register<LLAvatarList> 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<LLPanel*> items; + getItems(items); + for( std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); it++) + { + static_cast<LLAvatarListItem*>(*it)->setAvatarIconVisible(mShowIcons); + } +} + static bool findInsensitive(std::string haystack, const std::string& needle_upper) { LLStringUtil::toUpper(haystack); @@ -73,13 +89,22 @@ 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() { - if (mDirty) - refresh(); + // *NOTE dzaporozhan + // Call refresh() after draw() to avoid flickering of avatar list items. LLFlatListView::draw(); + + if (mDirty) + refresh(); } void LLAvatarList::setNameFilter(const std::string& filter) @@ -202,6 +227,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); } |
