summaryrefslogtreecommitdiff
path: root/indra/newview/llimfloater.cpp
diff options
context:
space:
mode:
authorSeth ProductEngine <slitovchuk@productengine.com>2012-05-07 22:40:56 +0300
committerSeth ProductEngine <slitovchuk@productengine.com>2012-05-07 22:40:56 +0300
commitfac210075f4c68db372ae0535e332ffe9765a5d1 (patch)
tree6c92b8145c1a056da7dd979e778f455d6da08397 /indra/newview/llimfloater.cpp
parent7b8251fd2f169136fc45e4c17104da676f75727b (diff)
CHUI-105 WIP Added tear-off and return behavior for IM floater.
XUI changed for Converstions multifloater and IM floater.
Diffstat (limited to 'indra/newview/llimfloater.cpp')
-rw-r--r--indra/newview/llimfloater.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index f743b5e2bf..df3521ecb0 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -28,6 +28,7 @@
#include "llimfloater.h"
+#include "lldraghandle.h"
#include "llnotificationsutil.h"
#include "llagent.h"
@@ -251,6 +252,12 @@ BOOL LLIMFloater::postBuild()
slide_right->setVisible(!mControlPanel->getParent()->getVisible());
slide_right->setClickedCallback(boost::bind(&LLIMFloater::onSlide, this));
+ LLButton* return_btn = getChild<LLButton>("return_btn");
+ return_btn->setCommitCallback(boost::bind(&LLFloater::onClickTearOff, this));
+
+ LLButton* tear_off_btn = getChild<LLButton>("tear_off_btn");
+ tear_off_btn->setCommitCallback(boost::bind(&LLFloater::onClickTearOff, this));
+
mInputEditor = getChild<LLLineEditor>("chat_editor");
mInputEditor->setMaxTextLength(1023);
// enable line history support for instant message bar
@@ -1194,3 +1201,42 @@ void LLIMFloater::onClickCloseBtn()
LLFloater::onClickCloseBtn();
}
+
+// virtual
+void LLIMFloater::updateTitleButtons()
+{
+ if (!mDragHandle)
+ {
+ return;
+ }
+
+ LLMultiFloater* host_floater = getHost();
+
+ bool is_hosted = host_floater != NULL;
+ if (is_hosted) ///< floater is hosted
+ {
+ for (S32 i = 0; i < BUTTON_COUNT; i++)
+ {
+ if (!mButtons[i])
+ {
+ continue;
+ }
+
+ // Hide the standard header buttons in a docked IM floater.
+ mButtons[i]->setVisible(false);
+ }
+ }
+ else ///< floater is torn off
+ {
+ LLFloater::updateTitleButtons();
+ }
+
+ // toggle floater's drag handle and title visibility
+ mDragHandle->setVisible(!is_hosted);
+
+ LLButton* return_btn = getChild<LLButton>("return_btn");
+ return_btn->setVisible(!is_hosted);
+
+ LLButton* tear_off_btn = getChild<LLButton>("tear_off_btn");
+ tear_off_btn->setVisible(is_hosted);
+}