summaryrefslogtreecommitdiff
path: root/indra/newview/llimfloatercontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llimfloatercontainer.cpp')
-rw-r--r--indra/newview/llimfloatercontainer.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 9b5055fb98..c8b8cb208d 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -40,6 +40,7 @@
//
LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed)
: LLMultiFloater(seed)
+ ,mMessagesPaneWidth(0)
{
mAutoResize = FALSE;
LLTransientFloaterMgr::getInstance()->addControlView(LLTransientFloaterMgr::IM, this);
@@ -185,4 +186,29 @@ void LLIMFloaterContainer::setMinimized(BOOL b)
}
}
+void LLIMFloaterContainer::toggleMessagesPane(bool expand)
+{
+ LLView* messages_pane = getChild<LLView>("im_box_tab_container");
+ bool is_expanded = messages_pane->getVisible();
+ if (is_expanded == expand)
+ {
+ return;
+ }
+
+ // Store the messages pane width before collapsing it.
+ if (!expand)
+ {
+ LLView* conversations_pane = getChild<LLView>("conversations_pane");
+ S32 horizontal_pad = messages_pane->getRect().mLeft - conversations_pane->getRect().mRight;
+ mMessagesPaneWidth = messages_pane->getRect().getWidth() + horizontal_pad;
+ }
+
+ // Show/hide the messages pane.
+ messages_pane->setVisible(expand);
+
+ S32 floater_width = getRect().getWidth();
+ floater_width += (expand ? mMessagesPaneWidth : -mMessagesPaneWidth);
+ reshape(floater_width, getRect().getHeight());
+}
+
// EOF