summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp51
1 files changed, 37 insertions, 14 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 4de6976534..ed4bb727cd 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -46,7 +46,6 @@
#include "llagentui.h"
#include "llappviewer.h"
#include "llavatariconctrl.h"
-#include "llbottomtray.h"
#include "llcallingcard.h"
#include "llchat.h"
#include "llimfloater.h"
@@ -61,6 +60,7 @@
#include "llnearbychat.h"
#include "llspeakers.h" //for LLIMSpeakerMgr
#include "lltextbox.h"
+#include "lltoolbarview.h"
#include "llviewercontrol.h"
#include "llviewerparcelmgr.h"
@@ -1675,27 +1675,48 @@ LLCallDialog::~LLCallDialog()
LLUI::removePopup(this);
}
-void LLCallDialog::getAllowedRect(LLRect& rect)
+BOOL LLCallDialog::postBuild()
{
- rect = gViewerWindow->getWorldViewRectScaled();
+ if (!LLDockableFloater::postBuild() || !gToolBarView)
+ return FALSE;
+
+ dockToToolbarButton("speak");
+
+ return TRUE;
}
-BOOL LLCallDialog::postBuild()
+void LLCallDialog::dockToToolbarButton(const std::string& toolbarButtonName)
{
- if (!LLDockableFloater::postBuild())
- return FALSE;
+ LLDockControl::DocAt dock_pos = getDockControlPos(toolbarButtonName);
+ LLView *anchor_panel = gToolBarView->findChildView(toolbarButtonName);
- // dock the dialog to the Speak Button, where other sys messages appear
- LLView *anchor_panel = LLBottomTray::getInstance()->getChild<LLView>("speak_panel");
+ setUseTongue(anchor_panel);
- setDockControl(new LLDockControl(
- anchor_panel, this,
- getDockTongue(), LLDockControl::TOP,
- boost::bind(&LLCallDialog::getAllowedRect, this, _1)));
+ setDockControl(new LLDockControl(anchor_panel, this, getDockTongue(dock_pos), dock_pos));
+}
- return TRUE;
+LLDockControl::DocAt LLCallDialog::getDockControlPos(const std::string& toolbarButtonName)
+{
+ LLCommandId command_id(toolbarButtonName);
+ S32 toolbar_loc = gToolBarView->hasCommand(command_id);
+
+ LLDockControl::DocAt doc_at = LLDockControl::TOP;
+
+ switch (toolbar_loc)
+ {
+ case LLToolBarView::TOOLBAR_LEFT:
+ doc_at = LLDockControl::RIGHT;
+ break;
+
+ case LLToolBarView::TOOLBAR_RIGHT:
+ doc_at = LLDockControl::LEFT;
+ break;
+ }
+
+ return doc_at;
}
+
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLOutgoingCallDialog
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2449,8 +2470,10 @@ void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& mess
LLChat chat(message);
chat.mSourceType = CHAT_SOURCE_SYSTEM;
+
+ LLFloater* chat_bar = LLFloaterReg::getInstance("chat_bar");
+ LLNearbyChat* nearby_chat = chat_bar->findChild<LLNearbyChat>("nearby_chat");
- LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
if(nearby_chat)
{
nearby_chat->addMessage(chat);