From e2824864590ded669eac3c53efbfc60d04107ee4 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Tue, 15 May 2012 22:19:20 +0300 Subject: CHUI-105 WIP Hide an additional close button for undocked state of an IM floater --- indra/newview/llimfloater.cpp | 10 ++++++++++ indra/newview/llimfloater.h | 3 +++ 2 files changed, 13 insertions(+) (limited to 'indra') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index cb489627fb..1ca3545aae 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -391,6 +391,12 @@ BOOL LLIMFloater::postBuild() } } +void LLIMFloater::onTearOffClicked(LLIMFloater* self) +{ + onClickTearOff(self); + updateTitleButtons(); +} + void LLIMFloater::boundVoiceChannel() { LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionID); @@ -1377,6 +1383,7 @@ void LLIMFloater::updateTitleButtons() } bool is_hosted = getHost() != NULL; + if (is_hosted) ///< floater is hosted { for (S32 i = 0; i < BUTTON_COUNT; i++) @@ -1391,6 +1398,7 @@ void LLIMFloater::updateTitleButtons() } mExpandCollapseBtn->setImageOverlay(getString("collapse_icon")); + } else ///< floater is torn off { @@ -1403,6 +1411,8 @@ void LLIMFloater::updateTitleButtons() } } + getChild("close_btn")->setVisible(is_hosted); + LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(mSessionID); if (session) { diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index 60b392952f..03f52fb316 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -93,6 +93,7 @@ public: // called when docked floater's position has been set by chiclet void setPositioned(bool b) { mPositioned = b; }; + void onVisibilityChange(const LLSD& new_visibility); // Implements LLVoiceClientStatusObserver::onChange() to enable the call @@ -139,6 +140,8 @@ private: /* virtual */ void onFocusLost(); /* virtual */ void onFocusReceived(); + void onTearOffClicked(LLIMFloater *self); + // Update the window title, input field help text, etc. void updateSessionName(const std::string& ui_title, const std::string& ui_label); -- cgit v1.2.3