From c4f22cd6a6f96546a39702097accc8557130d34a Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Mon, 8 Jun 2009 23:23:07 -0700 Subject: 'IM Received' button to '__ New IMs' --- linden/indra/newview/lloverlaybar.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'linden/indra/newview/lloverlaybar.cpp') diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp index 5dd5d39..91a7375 100644 --- a/linden/indra/newview/lloverlaybar.cpp +++ b/linden/indra/newview/lloverlaybar.cpp @@ -102,7 +102,8 @@ LLOverlayBar::LLOverlayBar() : LLPanel(), mMediaRemote(NULL), mVoiceRemote(NULL), - mMusicState(STOPPED) + mMusicState(STOPPED), + mOriginalIMLabel("") { setMouseOpaque(FALSE); setIsChrome(TRUE); @@ -129,6 +130,8 @@ BOOL LLOverlayBar::postBuild() setFocusRoot(TRUE); mBuilt = true; + mOriginalIMLabel = getChild("IM Received")->getLabelSelected(); + layoutButtons(); return TRUE; } @@ -192,9 +195,25 @@ void LLOverlayBar::refresh() BOOL buttons_changed = FALSE; BOOL im_received = gIMMgr->getIMReceived(); + int unread_count = gIMMgr->getIMUnreadCount(); LLButton* button = getChild("IM Received"); - if (button && button->getVisible() != im_received) + + if (button && button->getVisible() != im_received || + button && button->getVisible()) { + if (unread_count > 0) + { + if (unread_count > 1) + { + std::stringstream ss; + ss << unread_count << " " << getString("unread_count_string_plural"); + button->setLabel(ss.str()); + } + else + { + button->setLabel("1 " + mOriginalIMLabel); + } + } button->setVisible(im_received); sendChildToFront(button); moveChildToBackOfTabGroup(button); -- cgit v1.1