summaryrefslogtreecommitdiff
path: root/indra/newview/llimfloater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llimfloater.cpp')
-rw-r--r--indra/newview/llimfloater.cpp70
1 files changed, 10 insertions, 60 deletions
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index 50a9c56518..63eedcdfea 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -34,9 +34,9 @@
#include "llappviewer.h"
#include "llavatarnamecache.h"
#include "llbutton.h"
-#include "llbottomtray.h"
#include "llchannelmanager.h"
#include "llchiclet.h"
+#include "llchicletbar.h"
#include "llfloaterreg.h"
#include "llimfloatercontainer.h" // to replace separate IM Floaters with multifloater container
#include "llinventoryfunctions.h"
@@ -55,14 +55,8 @@
#include "llinventorymodel.h"
#include "llrootview.h"
#include "llspeakers.h"
-#include "llsidetray.h"
#include "llviewerchat.h"
-
-
-static const S32 RECT_PADDING_NOT_INIT = -1;
-static const S32 RECT_PADDING_NEED_RECALC = -2;
-
-S32 LLIMFloater::sAllowedRectRightPadding = RECT_PADDING_NOT_INIT;
+#include "llautoreplace.h"
LLIMFloater::LLIMFloater(const LLUUID& session_id)
: LLTransientDockableFloater(NULL, true, session_id),
@@ -123,14 +117,14 @@ void LLIMFloater::onFocusLost()
{
LLIMModel::getInstance()->resetActiveSessionID();
- LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(mSessionID, false);
+ LLChicletBar::getInstance()->getChicletPanel()->setChicletToggleState(mSessionID, false);
}
void LLIMFloater::onFocusReceived()
{
LLIMModel::getInstance()->setActiveSessionID(mSessionID);
- LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(mSessionID, true);
+ LLChicletBar::getInstance()->getChicletPanel()->setChicletToggleState(mSessionID, true);
if (getVisible())
{
@@ -240,12 +234,6 @@ LLIMFloater::~LLIMFloater()
//virtual
BOOL LLIMFloater::postBuild()
{
- // User-resizable control panels in P2P sessions look ugly (EXT-3470).
- if (mDialog == IM_NOTHING_SPECIAL || mDialog == IM_SESSION_P2P_INVITE)
- {
- getChild<LLLayoutStack>("im_panels")->setPanelUserResize("panel_im_control_panel", FALSE);
- }
-
const LLUUID& other_party_id = LLIMModel::getInstance()->getOtherParticipantID(mSessionID);
if (other_party_id.notNull())
{
@@ -267,6 +255,8 @@ BOOL LLIMFloater::postBuild()
mInputEditor->setMaxTextLength(1023);
// enable line history support for instant message bar
mInputEditor->setEnableLineHistory(TRUE);
+ // *TODO Establish LineEditor with autoreplace callback
+ mInputEditor->setAutoreplaceCallback(boost::bind(&LLAutoReplace::autoreplaceCallback, LLAutoReplace::getInstance(), _1, _2));
LLFontGL* font = LLViewerChat::getChatFont();
mInputEditor->setFont(font);
@@ -391,9 +381,6 @@ void LLIMFloater::onSlide()
getChild<LLButton>("slide_left_btn")->setVisible(mControlPanel->getParent()->getVisible());
getChild<LLButton>("slide_right_btn")->setVisible(!mControlPanel->getParent()->getVisible());
-
- LLLayoutStack* stack = getChild<LLLayoutStack>("im_panels");
- if (stack) stack->setAnimate(true);
}
//static
@@ -450,7 +437,7 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id)
if (floater->getDockControl() == NULL)
{
LLChiclet* chiclet =
- LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLChiclet>(
+ LLChicletBar::getInstance()->getChicletPanel()->findChiclet<LLChiclet>(
session_id);
if (chiclet == NULL)
{
@@ -458,11 +445,11 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id)
}
else
{
- LLBottomTray::getInstance()->getChicletPanel()->scrollToChiclet(chiclet);
+ LLChicletBar::getInstance()->getChicletPanel()->scrollToChiclet(chiclet);
}
floater->setDockControl(new LLDockControl(chiclet, floater, floater->getDockTongue(),
- LLDockControl::TOP, boost::bind(&LLIMFloater::getAllowedRect, floater, _1)));
+ LLDockControl::BOTTOM));
}
// window is positioned, now we can show it.
@@ -472,43 +459,6 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id)
return floater;
}
-//static
-bool LLIMFloater::resetAllowedRectPadding()
-{
- //reset allowed rect right padding if "SidebarCameraMovement" option
- //or sidebar state changed
- sAllowedRectRightPadding = RECT_PADDING_NEED_RECALC ;
- return true;
-}
-
-void LLIMFloater::getAllowedRect(LLRect& rect)
-{
- if (sAllowedRectRightPadding == RECT_PADDING_NOT_INIT) //wasn't initialized
- {
- gSavedSettings.getControl("SidebarCameraMovement")->getSignal()->connect(boost::bind(&LLIMFloater::resetAllowedRectPadding));
-
- LLSideTray* side_bar = LLSideTray::getInstance();
- side_bar->setVisibleWidthChangeCallback(boost::bind(&LLIMFloater::resetAllowedRectPadding));
- sAllowedRectRightPadding = RECT_PADDING_NEED_RECALC;
- }
-
- rect = gViewerWindow->getWorldViewRectScaled();
- if (sAllowedRectRightPadding == RECT_PADDING_NEED_RECALC) //recalc allowed rect right padding
- {
- LLPanel* side_bar_tabs =
- gViewerWindow->getRootView()->getChild<LLPanel> (
- "side_bar_tabs");
- sAllowedRectRightPadding = side_bar_tabs->getRect().getWidth();
- LLTransientFloaterMgr::getInstance()->addControlView(side_bar_tabs);
-
- if (gSavedSettings.getBOOL("SidebarCameraMovement") == FALSE)
- {
- sAllowedRectRightPadding += LLSideTray::getInstance()->getVisibleWidth();
- }
- }
- rect.mRight -= sAllowedRectRightPadding;
-}
-
void LLIMFloater::setDocked(bool docked, bool pop_on_undock)
{
// update notification channel state
@@ -560,7 +510,7 @@ void LLIMFloater::setVisible(BOOL visible)
if(!visible)
{
- LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(mSessionID);
+ LLIMChiclet* chiclet = LLChicletBar::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(mSessionID);
if(chiclet)
{
chiclet->setToggleState(false);