diff options
-rw-r--r-- | indra/newview/llchiclet.cpp | 44 | ||||
-rw-r--r-- | indra/newview/llsyswellwindow.cpp | 9 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_activeim_row.xml | 42 |
3 files changed, 77 insertions, 18 deletions
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index b919195fb2..e416151748 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -54,10 +54,12 @@ static LLDefaultChildRegistry::Register<LLChicletPanel> t1("chiclet_panel"); static LLDefaultChildRegistry::Register<LLNotificationChiclet> t2("chiclet_notification"); static LLDefaultChildRegistry::Register<LLIMP2PChiclet> t3("chiclet_im_p2p"); static LLDefaultChildRegistry::Register<LLIMGroupChiclet> t4("chiclet_im_group"); +static LLDefaultChildRegistry::Register<LLAdHocChiclet> t5("chiclet_im_adhoc"); static const LLRect CHICLET_RECT(0, 25, 25, 0); -static const LLRect CHICLET_ICON_RECT(0, 24, 24, 0); +static const LLRect CHICLET_ICON_RECT(0, 22, 22, 0); static const LLRect VOICE_INDICATOR_RECT(25, 25, 45, 0); +static const S32 OVERLAY_ICON_SHIFT = 2; // used for shifting of an overlay icon for new massages in a chiclet // static const S32 LLChicletPanel::s_scroll_ratio = 10; @@ -217,13 +219,15 @@ LLIMChiclet::LLIMChiclet(const LLIMChiclet::Params& p) icon_params.visible = false; icon_params.image = LLUI::getUIImage(p.new_messages_icon_name); mNewMessagesIcon = LLUICtrlFactory::create<LLIconCtrl>(icon_params); + addChild(mNewMessagesIcon); + // adjust size and position of an icon LLRect chiclet_rect = p.rect; - LLRect overlay_icon_rect = LLRect(chiclet_rect.getWidth()/2, chiclet_rect.mTop, chiclet_rect.mRight, chiclet_rect.getHeight()/2); - // shift an icon a little bit to the right and up corner of a chiclet - overlay_icon_rect.translate(overlay_icon_rect.getWidth()/5, overlay_icon_rect.getHeight()/5); + LLRect overlay_icon_rect = LLRect(chiclet_rect.getWidth()/2, chiclet_rect.getHeight(), chiclet_rect.getWidth(), chiclet_rect.getHeight()/2); mNewMessagesIcon->setRect(overlay_icon_rect); - addChild(mNewMessagesIcon); + + // shift an icon a little bit to the right and up corner of a chiclet + overlay_icon_rect.translate(OVERLAY_ICON_SHIFT, OVERLAY_ICON_SHIFT); setShowCounter(false); } @@ -602,6 +606,9 @@ BOOL LLAdHocChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask) LLIMGroupChiclet::Params::Params() : group_icon("group_icon") +, unread_notifications("unread_notifications") +, speaker("speaker") +, show_speaker("show_speaker") { rect(CHICLET_RECT); @@ -880,19 +887,34 @@ BOOL LLChicletPanel::postBuild() void LLChicletPanel::onCurrentVoiceChannelChanged(const LLUUID& session_id) { - for(chiclet_list_t::iterator it = mChicletList.begin(); it != mChicletList.end(); ++it) + static LLUUID s_previous_active_voice_session_id; + + std::list<LLChiclet*> chiclets = LLIMChiclet::sFindChicletsSignal(session_id); + + for(std::list<LLChiclet *>::iterator it = chiclets.begin(); it != chiclets.end(); ++it) { LLIMChiclet* chiclet = dynamic_cast<LLIMChiclet*>(*it); if(chiclet) { - if(chiclet->getSessionId() == session_id) + chiclet->setShowSpeaker(true); + } + } + + if(!s_previous_active_voice_session_id.isNull() && s_previous_active_voice_session_id != session_id) + { + chiclets = LLIMChiclet::sFindChicletsSignal(s_previous_active_voice_session_id); + + for(std::list<LLChiclet *>::iterator it = chiclets.begin(); it != chiclets.end(); ++it) + { + LLIMChiclet* chiclet = dynamic_cast<LLIMChiclet*>(*it); + if(chiclet) { - chiclet->setShowSpeaker(true); - continue; + chiclet->setShowSpeaker(false); } - chiclet->setShowSpeaker(false); - } + } } + + s_previous_active_voice_session_id = session_id; } S32 LLChicletPanel::calcChickletPanleWidth() diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 4422c4b672..2fb6550107 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -501,14 +501,14 @@ LLSysWellWindow::RowPanel::RowPanel(const LLSysWellWindow* parent, const LLUUID& switch (im_chiclet_type) { case LLIMChiclet::TYPE_GROUP: + mChiclet = getChild<LLIMGroupChiclet>("group_chiclet"); + break; case LLIMChiclet::TYPE_AD_HOC: - mChiclet = getChild<LLIMChiclet>("group_chiclet"); - childSetVisible("p2p_chiclet", false); + mChiclet = getChild<LLAdHocChiclet>("adhoc_chiclet"); break; case LLIMChiclet::TYPE_UNKNOWN: // assign mChiclet a non-null value anyway case LLIMChiclet::TYPE_IM: - mChiclet = getChild<LLIMChiclet>("p2p_chiclet"); - childSetVisible("group_chiclet", false); + mChiclet = getChild<LLIMP2PChiclet>("p2p_chiclet"); break; } @@ -517,6 +517,7 @@ LLSysWellWindow::RowPanel::RowPanel(const LLSysWellWindow* parent, const LLUUID& mChiclet->setSessionId(sessionId); mChiclet->setIMSessionName(name); mChiclet->setOtherParticipantId(otherParticipantId); + mChiclet->setVisible(true); LLTextBox* contactName = getChild<LLTextBox>("contact_name"); contactName->setValue(name); diff --git a/indra/newview/skins/default/xui/en/panel_activeim_row.xml b/indra/newview/skins/default/xui/en/panel_activeim_row.xml index 8b815b0f71..5562ec8406 100644 --- a/indra/newview/skins/default/xui/en/panel_activeim_row.xml +++ b/indra/newview/skins/default/xui/en/panel_activeim_row.xml @@ -15,7 +15,16 @@ top="3" left="5" height="25" - width="25"> + width="25" + visible="false" + speaker.name="speaker_p2p" + speaker.width="20" + speaker.height="25" + speaker.left="25" + speaker.top="25" + speaker.auto_update="true" + speaker.draw_border="false" + speaker.visible="false"> </chiclet_im_p2p> <chiclet_im_group name="group_chiclet" @@ -24,14 +33,41 @@ top="3" left="5" height="25" - width="25"> + width="25" + visible="false" + speaker.name="speaker_grp" + speaker.width="20" + speaker.height="25" + speaker.left="25" + speaker.top="25" + speaker.auto_update="true" + speaker.draw_border="false" + speaker.visible="false"> </chiclet_im_group> + <chiclet_im_adhoc + name="adhoc_chiclet" + layout="topleft" + follows="left" + top="3" + left="5" + height="25" + width="25" + visible="false" + speaker.name="speaker_hoc" + speaker.width="20" + speaker.height="25" + speaker.left="25" + speaker.top="25" + speaker.auto_update="true" + speaker.draw_border="false" + speaker.visible="false"> + </chiclet_im_adhoc> <text type="string" name="contact_name" layout="topleft" top="10" - left_pad="0" + left_pad="20" height="14" width="245" length="1" |