summaryrefslogtreecommitdiff
path: root/indra/newview/llnearbychat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llnearbychat.cpp')
-rw-r--r--indra/newview/llnearbychat.cpp44
1 files changed, 34 insertions, 10 deletions
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index 6e90d22d89..bbab9944f3 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -55,11 +55,13 @@
#include "lldraghandle.h"
#include "lltrans.h"
+#include "llbottomtray.h"
+#include "llnearbychatbar.h"
static const S32 RESIZE_BAR_THICKNESS = 3;
-LLNearbyChat::LLNearbyChat(const LLSD& key) :
- LLFloater(key)
+LLNearbyChat::LLNearbyChat(const LLSD& key)
+ : LLDockableFloater(NULL, key)
,mChatHistory(NULL)
{
@@ -89,7 +91,17 @@ BOOL LLNearbyChat::postBuild()
setCanResize(true);
- return LLFloater::postBuild();
+ if(!LLDockableFloater::postBuild())
+ return false;
+
+ if (getDockControl() == NULL)
+ {
+ setDockControl(new LLDockControl(
+ LLBottomTray::getInstance()->getNearbyChatBar(), this,
+ getDockTongue(), LLDockControl::LEFT, boost::bind(&LLNearbyChat::getAllowedRect, this, _1)));
+ }
+
+ return true;
}
@@ -255,13 +267,25 @@ void LLNearbyChat::onOpen(const LLSD& key )
void LLNearbyChat::setDocked (bool docked, bool pop_on_undock)
{
- LLFloater::setDocked(docked, pop_on_undock);
+ LLDockableFloater::setDocked(docked, pop_on_undock);
- if(docked)
- {
- //move nearby_chat to right bottom
- LLRect rect = gFloaterView->getRect();
- setRect(LLRect(rect.mLeft,getRect().getHeight(),rect.mLeft+getRect().getWidth(),0));
- }
+ setCanResize(!docked);
+}
+
+void LLNearbyChat::setRect (const LLRect &rect)
+{
+ LLDockableFloater::setRect(rect);
+}
+
+void LLNearbyChat::getAllowedRect(LLRect& rect)
+{
+ rect = gViewerWindow->getWorldViewRect();
+}
+void LLNearbyChat::setVisible (BOOL visible)
+{
+ LLDockableFloater::setVisible(visible);
+}
+void LLNearbyChat::toggleWindow()
+{
}