diff options
author | Mike Antipov <mantipov@productengine.com> | 2009-12-24 14:24:09 +0200 |
---|---|---|
committer | Mike Antipov <mantipov@productengine.com> | 2009-12-24 14:24:09 +0200 |
commit | d75ba371a2fbbd5af981168dffe86079357ef719 (patch) | |
tree | b2cf454ce3a8bbfb65d96db5d7b09ccd8b784f04 /indra/newview | |
parent | 2773a3bb7b864f61064543b4bdbb61dd40bdb298 (diff) |
Work on normal task EXT-3636 (Code Improvements: Voice control panels - Make Voice states and fade timeout xml driven)
-- made Avatar List Item icon color xml-driven.
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llavatarlistitem.cpp | 43 | ||||
-rw-r--r-- | indra/newview/llavatarlistitem.h | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/colors.xml | 18 |
3 files changed, 58 insertions, 6 deletions
diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 76e2f2191a..61361d78e6 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -158,7 +158,6 @@ void LLAvatarListItem::changed(U32 mask) void LLAvatarListItem::setOnline(bool online) { // *FIX: setName() overrides font style set by setOnline(). Not an issue ATM. - // *TODO: Make the colors configurable via XUI. if (mOnlineStatus != E_UNKNOWN && (bool) mOnlineStatus == online) return; @@ -167,9 +166,6 @@ void LLAvatarListItem::setOnline(bool online) // Change avatar name font style depending on the new online status. setStyle(online ? IS_ONLINE : IS_OFFLINE); - - // Make the icon fade if the avatar goes offline. - mAvatarIcon->setColor(online ? LLColor4::white : LLColor4::smoke); } void LLAvatarListItem::setName(const std::string& name) @@ -193,8 +189,8 @@ void LLAvatarListItem::setStyle(EItemStyle voice_state) // hyperlinks, as their styles will be wrong. setNameInternal(mAvatarName->getText(), mHighlihtSubstring); - // *TODO: move icon colors into colors.xml - mAvatarIcon->setColor(voice_state == IS_VOICE_JOINED ? LLColor4::white : LLColor4::smoke); + icon_color_map_t item_icon_color_map = getItemIconColorMap(); + mAvatarIcon->setColor(item_icon_color_map[voice_state]); } void LLAvatarListItem::setAvatarId(const LLUUID& id, bool ignore_status_changes) @@ -462,3 +458,38 @@ LLAvatarListItem::voice_state_map_t LLAvatarListItem::getItemStylesParams() return item_styles_params_map; } + +// static +LLAvatarListItem::icon_color_map_t LLAvatarListItem::getItemIconColorMap() +{ + static icon_color_map_t item_icon_color_map; + if (!item_icon_color_map.empty()) return item_icon_color_map; + + item_icon_color_map.insert( + std::make_pair(IS_DEFAULT, + LLUIColorTable::instance().getColor("AvatarListItemIconDefaultColor", LLColor4::white))); + + item_icon_color_map.insert( + std::make_pair(IS_VOICE_INVITED, + LLUIColorTable::instance().getColor("AvatarListItemIconVoiceInvitedColor", LLColor4::white))); + + item_icon_color_map.insert( + std::make_pair(IS_VOICE_JOINED, + LLUIColorTable::instance().getColor("AvatarListItemIconVoiceJoinedColor", LLColor4::white))); + + item_icon_color_map.insert( + std::make_pair(IS_VOICE_LEFT, + LLUIColorTable::instance().getColor("AvatarListItemIconVoiceLeftColor", LLColor4::white))); + + item_icon_color_map.insert( + std::make_pair(IS_ONLINE, + LLUIColorTable::instance().getColor("AvatarListItemIconOnlineColor", LLColor4::white))); + + item_icon_color_map.insert( + std::make_pair(IS_OFFLINE, + LLUIColorTable::instance().getColor("AvatarListItemIconOfflineColor", LLColor4::white))); + + return item_icon_color_map; +} + +// EOF diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 628061b033..ed556fbcb4 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -130,6 +130,9 @@ private: typedef std::map<EItemStyle, LLStyle::Params> voice_state_map_t; static voice_state_map_t getItemStylesParams(); + typedef std::map<EItemStyle, LLColor4> icon_color_map_t; + static icon_color_map_t getItemIconColorMap(); + LLAvatarIconCtrl* mAvatarIcon; LLTextBox* mAvatarName; LLTextBox* mLastInteractionTime; diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 706245a479..cb511c2f0b 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -102,6 +102,24 @@ name="AvatarNameColor" reference="White" /> <color + name="AvatarListItemIconDefaultColor" + reference="White" /> + <color + name="AvatarListItemIconOnlineColor" + reference="White" /> + <color + name="AvatarListItemIconOfflineColor" + value="0.5 0.5 0.5 0.5" /> + <color + name="AvatarListItemIconVoiceInvitedColor" + reference="AvatarListItemIconOfflineColor" /> + <color + name="AvatarListItemIconVoiceJoinedColor" + reference="AvatarListItemIconOnlineColor" /> + <color + name="AvatarListItemIconVoiceLeftColor" + reference="AvatarListItemIconOfflineColor" /> + <color name="BackgroundChatColor" reference="DkGray_66" /> <color |