From 7eaeb88bc37a747ff82fd37df84592f54c88cdbf Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Thu, 10 May 2012 20:40:15 +0300 Subject: CHUI-105 WIP Added expand/collapse behavior for Conversations floater messages pane. --- indra/newview/llimfloatercontainer.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'indra/newview/llimfloatercontainer.cpp') 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("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("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 -- cgit v1.2.3