diff options
author | Ychebotarev ProductEngine <ychebotarev@productengine.com> | 2010-02-05 13:03:26 +0200 |
---|---|---|
committer | Ychebotarev ProductEngine <ychebotarev@productengine.com> | 2010-02-05 13:03:26 +0200 |
commit | b79b8f87a37888decd3f82e9e255cce641a3955f (patch) | |
tree | 0e72cecd20f15ea200a84a72979e4f7b8beea436 /indra/newview | |
parent | bc5ad04d6164d186cf504212ea559405b8608811 (diff) |
finished with EXT-2753 - Implement Avatar icons on IM multifloater tabs
add floater flashing, fix group icon sizes, fix click,some code cleanup, ect.
also I remove mIconCtrlWidth/Height since its kinda useless - mIconCtrlPad do the same thing...
IconSize will be btn_height-2*mIconCtrlPad - simple and good enough.
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llimfloatercontainer.cpp | 50 | ||||
-rw-r--r-- | indra/newview/llimfloatercontainer.h | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_im_container.xml | 2 |
3 files changed, 10 insertions, 43 deletions
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 7c7a4222d4..9539553121 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -37,6 +37,7 @@ #include "llfloaterreg.h" #include "llimview.h" #include "llavatariconctrl.h" +#include "llgroupiconctrl.h" #include "llagent.h" // @@ -90,23 +91,15 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, LLUUID session_id = floaterp->getKey(); + LLIconCtrl* icon = 0; + if(gAgent.isInGroup(session_id)) { - mSessions[session_id] = floaterp; - LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(session_id); - LLGroupMgr* gm = LLGroupMgr::getInstance(); - gm->addObserver(session_id, this); - floaterp->mCloseSignal.connect(boost::bind(&LLIMFloaterContainer::onCloseFloater, this, session_id)); + LLGroupIconCtrl::Params icon_params = LLUICtrlFactory::instance().getDefaultParams<LLGroupIconCtrl>(); + icon_params.group_id = session_id; + icon = LLUICtrlFactory::instance().createWidget<LLGroupIconCtrl>(icon_params); - if (group_data && group_data->mInsigniaID.notNull()) - { - mTabContainer->setTabImage(get_ptr_in_map(mSessions, session_id), group_data->mInsigniaID); - } - else - { - mTabContainer->setTabImage(floaterp, "Generic_Group"); - gm->sendGroupPropertiesRequest(session_id); - } + mSessions[session_id] = floaterp; } else { @@ -114,27 +107,11 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, LLAvatarIconCtrl::Params icon_params = LLUICtrlFactory::instance().getDefaultParams<LLAvatarIconCtrl>(); icon_params.avatar_id = avatar_id; - LLAvatarIconCtrl* icon = LLUICtrlFactory::instance().createWidget<LLAvatarIconCtrl>(icon_params); - icon->setValue(avatar_id); - mTabContainer->setTabImage(floaterp, icon); - - /* - LLAvatarPropertiesProcessor& app = LLAvatarPropertiesProcessor::instance(); - app.addObserver(avatar_id, this); - floaterp->mCloseSignal.connect(boost::bind(&LLIMFloaterContainer::onCloseFloater, this, avatar_id)); - mSessions[avatar_id] = floaterp; + icon = LLUICtrlFactory::instance().createWidget<LLAvatarIconCtrl>(icon_params); - LLUUID* icon_id_ptr = LLAvatarIconIDCache::getInstance()->get(avatar_id); - if(icon_id_ptr && icon_id_ptr->notNull()) - { - mTabContainer->setTabImage(floaterp, *icon_id_ptr); - } - else - { - mTabContainer->setTabImage(floaterp, "Generic_Person"); - app.sendAvatarPropertiesRequest(avatar_id); - }*/ + mSessions[avatar_id] = floaterp; } + mTabContainer->setTabImage(floaterp, icon); } void LLIMFloaterContainer::processProperties(void* data, enum EAvatarProcessorType type) @@ -167,13 +144,6 @@ void LLIMFloaterContainer::changed(const LLUUID& group_id, LLGroupChange gc) } } -void LLIMFloaterContainer::onCloseFloater(LLUUID id) -{ - LLAvatarPropertiesProcessor::instance().removeObserver(id, this); - LLGroupMgr::instance().removeObserver(id, this); - -} - void LLIMFloaterContainer::onNewMessageReceived(const LLSD& data) { LLUUID session_id = data["from_id"].asUUID(); diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index bc06f0cbd3..daf367da11 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -69,7 +69,6 @@ private: typedef std::map<LLUUID,LLFloater*> avatarID_panel_map_t; avatarID_panel_map_t mSessions; - void onCloseFloater(LLUUID avatar_id); void onNewMessageReceived(const LLSD& data); }; diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml index 0d1a4a831d..978b40da77 100644 --- a/indra/newview/skins/default/xui/en/floater_im_container.xml +++ b/indra/newview/skins/default/xui/en/floater_im_container.xml @@ -21,8 +21,6 @@ tab_position="bottom" tab_width="64" tab_max_width = "134" - tab_icon_ctrl_width = "16" - tab_icon_ctrl_height = "16" tab_height="16" use_custom_icon_ctrl="true" tab_icon_ctrl_pad="2" |