summaryrefslogtreecommitdiff
path: root/indra/newview/llnearbychatbar.cpp
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2011-09-27 15:41:06 -0700
committerLeyla Farazha <leyla@lindenlab.com>2011-09-27 15:41:06 -0700
commit0207d7e9e4e5b509b5905256a56ac2138b35cac3 (patch)
tree904c34ad82f59d0515600b7745252036404f81f1 /indra/newview/llnearbychatbar.cpp
parentcb699e3f2d64999e9817d0c4df5b7f9484e8e722 (diff)
EXP-1247 Nearby chat as part of chat floater
Diffstat (limited to 'indra/newview/llnearbychatbar.cpp')
-rw-r--r--indra/newview/llnearbychatbar.cpp38
1 files changed, 27 insertions, 11 deletions
diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp
index 185acb1414..258aa9a8bf 100644
--- a/indra/newview/llnearbychatbar.cpp
+++ b/indra/newview/llnearbychatbar.cpp
@@ -49,6 +49,8 @@
#include "llrootview.h"
#include "llviewerchat.h"
+#include "llresizehandle.h"
+
S32 LLNearbyChatBar::sLastSpecialChatChannel = 0;
// legacy callback glue
@@ -414,8 +416,7 @@ LLCtrlListInterface* LLGestureComboList::getListInterface()
LLNearbyChatBar::LLNearbyChatBar(const LLSD& key)
: LLFloater(key),
mChatBox(NULL)
-{
- mSpeakerMgr = LLLocalSpeakerMgr::getInstance();
+{ mSpeakerMgr = LLLocalSpeakerMgr::getInstance();
}
//virtual
@@ -437,6 +438,10 @@ BOOL LLNearbyChatBar::postBuild()
mChatBox->setEnableLineHistory(TRUE);
mChatBox->setFont(LLViewerChat::getChatFont());
+
+ LLUICtrl* show_btn = getChild<LLUICtrl>("show_nearby_chat");
+ show_btn->setCommitCallback(boost::bind(&LLNearbyChatBar::onToggleNearbyChatPanel, this));
+
mOutputMonitor = getChild<LLOutputMonitorCtrl>("chat_zone_indicator");
mOutputMonitor->setVisible(FALSE);
@@ -678,6 +683,25 @@ void LLNearbyChatBar::sendChat( EChatType type )
}
}
+
+void LLNearbyChatBar::onToggleNearbyChatPanel()
+{
+ LLView* nearby_chat = getChildView("nearby_chat");
+
+ if (nearby_chat->getVisible())
+ {
+ nearby_chat->setVisible(FALSE);
+ reshape(getRect().getWidth(), 60);
+ mResizeHandle[0]->setMaxHeight(60);
+ }
+ else
+ {
+ nearby_chat->setVisible(TRUE);
+ reshape(getRect().getWidth(), 360);
+ mResizeHandle[0]->setMaxHeight(S32_MAX);
+ }
+}
+
void LLNearbyChatBar::onChatBoxCommit()
{
if (mChatBox->getText().length() > 0)
@@ -781,6 +805,7 @@ void LLNearbyChatBar::startChat(const char* line)
return;
cb->setVisible(TRUE);
+ cb->setFocus(TRUE);
cb->mChatBox->setFocus(TRUE);
if (line)
@@ -812,15 +837,6 @@ void LLNearbyChatBar::stopChat()
gAgent.stopTyping();
}
-void LLNearbyChatBar::onClose(bool app_quitting)
-{
- LLFloater* nearby_chat = LLFloaterReg::findInstance("nearby_chat", LLSD());
- if (nearby_chat)
- {
- nearby_chat->closeFloater(app_quitting);
- }
-}
-
// If input of the form "/20foo" or "/20 foo", returns "foo" and channel 20.
// Otherwise returns input and channel 0.
LLWString LLNearbyChatBar::stripChannelNumber(const LLWString &mesg, S32* channel)