summaryrefslogtreecommitdiff
path: root/indra/newview/llimfloatercontainer.cpp
diff options
context:
space:
mode:
authorSeth ProductEngine <slitovchuk@productengine.com>2012-05-10 20:40:15 +0300
committerSeth ProductEngine <slitovchuk@productengine.com>2012-05-10 20:40:15 +0300
commit7eaeb88bc37a747ff82fd37df84592f54c88cdbf (patch)
treeed11d8be3765f595c52c671b84cafdad623434ff /indra/newview/llimfloatercontainer.cpp
parentdfe6ce4be9b2b61a689e6cce41a9da91bd9a8b73 (diff)
CHUI-105 WIP Added expand/collapse behavior for Conversations floater messages pane.
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