summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llimconversation.cpp51
-rw-r--r--indra/newview/llimconversation.h3
2 files changed, 36 insertions, 18 deletions
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp
index 4774cc2d5a..ec7e0ee6cb 100644
--- a/indra/newview/llimconversation.cpp
+++ b/indra/newview/llimconversation.cpp
@@ -43,6 +43,7 @@ const F32 REFRESH_INTERVAL = 0.2f;
LLIMConversation::LLIMConversation(const LLUUID& session_id)
: LLTransientDockableFloater(NULL, true, session_id)
, mIsP2PChat(false)
+ , mWasHosted(false)
, mExpandCollapseBtn(NULL)
, mTearOffBtn(NULL)
, mCloseBtn(NULL)
@@ -80,6 +81,8 @@ LLIMConversation::~LLIMConversation()
BOOL LLIMConversation::postBuild()
{
+ BOOL result;
+
mCloseBtn = getChild<LLButton>("close_btn");
mCloseBtn->setCommitCallback(boost::bind(&LLFloater::onClickClose, this));
@@ -103,6 +106,7 @@ BOOL LLIMConversation::postBuild()
}
buildParticipantList();
+
updateHeaderAndToolbar();
if (isChatMultiTab())
@@ -111,13 +115,14 @@ BOOL LLIMConversation::postBuild()
{
setCanClose(FALSE);
}
- return LLFloater::postBuild();
+ result = LLFloater::postBuild();
}
else
{
- return LLDockableFloater::postBuild();
+ result = LLDockableFloater::postBuild();
}
+ return result;
}
void LLIMConversation::draw()
@@ -215,7 +220,7 @@ bool LLIMConversation::onIMShowModesMenuItemEnable(const LLSD& userdata)
return (plain_text && (is_not_names || mIsP2PChat));
}
-void LLIMConversation::updateHeaderAndToolbar()
+void LLIMConversation::hideOrShowTitle()
{
bool is_hosted = getHost() != NULL;
@@ -227,23 +232,9 @@ void LLIMConversation::updateHeaderAndToolbar()
if (is_hosted)
{
- for (S32 i = 0; i < BUTTON_COUNT; i++)
- {
- if (mButtons[i])
- {
- // Hide the standard header buttons in a docked IM floater.
- mButtons[i]->setVisible(false);
- }
- }
-
// we don't show the header when the floater is hosted, so reshape floater contents
// to occupy the header space.
- LLRect floater_rect = getRect();
- contents_rect.setOriginAndSize(
- contents_rect.mLeft,
- contents_rect.mBottom,
- floater_rect.getWidth(),
- floater_rect.getHeight());
+ contents_rect.mTop += getHeaderHeight();
}
else
{
@@ -253,6 +244,30 @@ void LLIMConversation::updateHeaderAndToolbar()
floater_contents->setShape(contents_rect);
}
+}
+
+void LLIMConversation::hideAllStandardButtons()
+{
+ for (S32 i = 0; i < BUTTON_COUNT; i++)
+ {
+ if (mButtons[i])
+ {
+ // Hide the standard header buttons in a docked IM floater.
+ mButtons[i]->setVisible(false);
+ }
+ }
+}
+
+void LLIMConversation::updateHeaderAndToolbar()
+{
+ bool is_hosted = getHost() != NULL;
+
+ if (is_hosted)
+ {
+ hideAllStandardButtons();
+ }
+
+ hideOrShowTitle();
// Participant list should be visible only in torn off floaters.
bool is_participant_list_visible =
diff --git a/indra/newview/llimconversation.h b/indra/newview/llimconversation.h
index 19d1e523f0..e6b4f534cc 100644
--- a/indra/newview/llimconversation.h
+++ b/indra/newview/llimconversation.h
@@ -89,6 +89,9 @@ protected:
void buildParticipantList();
void onSortMenuItemClicked(const LLSD& userdata);
+ void hideOrShowTitle();
+ void hideAllStandardButtons();
+
bool mIsNearbyChat;
bool mIsP2PChat;
bool mWasHosted;