From 2773a3bb7b864f61064543b4bdbb61dd40bdb298 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 24 Dec 2009 13:13:49 +0200 Subject: Work on normal task EXT-3636 (Code Improvements: Voice control panels - Make Voice states and fade timeout xml driven) -- added possibility to set avatar item online/offline styles via xml. -- commited fake xml panel file with styles missed in previous commit. --HG-- branch : product-engine --- indra/newview/llavatarlistitem.cpp | 15 ++++++++++++--- indra/newview/llavatarlistitem.h | 2 ++ 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index d70e3c61b9..76e2f2191a 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -166,8 +166,7 @@ void LLAvatarListItem::setOnline(bool online) mOnlineStatus = (EOnlineStatus) online; // Change avatar name font style depending on the new online status. - mAvatarNameStyle.color = online ? LLColor4::white : LLColor4::grey; - setNameInternal(mAvatarName->getText(), mHighlihtSubstring); + setStyle(online ? IS_ONLINE : IS_OFFLINE); // Make the icon fade if the avatar goes offline. mAvatarIcon->setColor(online ? LLColor4::white : LLColor4::smoke); @@ -192,7 +191,7 @@ void LLAvatarListItem::setStyle(EItemStyle voice_state) // *NOTE: You cannot set the style on a text box anymore, you must // rebuild the text. This will cause problems if the text contains // hyperlinks, as their styles will be wrong. - mAvatarName->setText(mAvatarName->getText(), mAvatarNameStyle); + setNameInternal(mAvatarName->getText(), mHighlihtSubstring); // *TODO: move icon colors into colors.xml mAvatarIcon->setColor(voice_state == IS_VOICE_JOINED ? LLColor4::white : LLColor4::smoke); @@ -441,6 +440,14 @@ LLAvatarListItem::voice_state_map_t LLAvatarListItem::getItemStylesParams() item_styles_params_map.insert( std::make_pair(IS_VOICE_LEFT, params_panel->getChild("voice_call_left_style")->getDefaultStyle())); + + item_styles_params_map.insert( + std::make_pair(IS_ONLINE, + params_panel->getChild("online_style")->getDefaultStyle())); + + item_styles_params_map.insert( + std::make_pair(IS_OFFLINE, + params_panel->getChild("offline_style")->getDefaultStyle())); } else { @@ -448,6 +455,8 @@ LLAvatarListItem::voice_state_map_t LLAvatarListItem::getItemStylesParams() item_styles_params_map.insert(std::make_pair(IS_VOICE_INVITED, LLStyle::Params())); item_styles_params_map.insert(std::make_pair(IS_VOICE_JOINED, LLStyle::Params())); item_styles_params_map.insert(std::make_pair(IS_VOICE_LEFT, LLStyle::Params())); + item_styles_params_map.insert(std::make_pair(IS_ONLINE, LLStyle::Params())); + item_styles_params_map.insert(std::make_pair(IS_OFFLINE, LLStyle::Params())); } if (params_panel) params_panel->die(); diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index d544ed459e..628061b033 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -51,6 +51,8 @@ public: IS_VOICE_INVITED, IS_VOICE_JOINED, IS_VOICE_LEFT, + IS_ONLINE, + IS_OFFLINE, } EItemStyle; class ContextMenu -- cgit v1.2.3