summaryrefslogtreecommitdiff
path: root/indra/newview/llimconversation.cpp
diff options
context:
space:
mode:
authorAlexanderP ProductEngine <apaschenko@productengine.com>2012-07-19 19:16:36 +0300
committerAlexanderP ProductEngine <apaschenko@productengine.com>2012-07-19 19:16:36 +0300
commit6227a5c273efbe732c8068400d7e4b5486981bba (patch)
treea2d9c51df71b60361890f49986f7c996f8281b6c /indra/newview/llimconversation.cpp
parentefa73d4975afda19ee5255d5cca33fa96fc21eb4 (diff)
CHUI-231, CHUI-233 [FIXED] - Modified and simplified algorithm of reshaping floater's body (content) and showing/hiding of the title for prevent of present and future issues with floater's repositioning
Diffstat (limited to 'indra/newview/llimconversation.cpp')
-rw-r--r--indra/newview/llimconversation.cpp32
1 files changed, 11 insertions, 21 deletions
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp
index ec7e0ee6cb..ec534b903d 100644
--- a/indra/newview/llimconversation.cpp
+++ b/indra/newview/llimconversation.cpp
@@ -43,7 +43,6 @@ 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)
@@ -224,26 +223,17 @@ void LLIMConversation::hideOrShowTitle()
{
bool is_hosted = getHost() != NULL;
- if (mWasHosted != is_hosted)
- {
- mWasHosted = is_hosted;
- LLView* floater_contents = getChild<LLView>("contents_view");
- LLRect contents_rect = floater_contents->getRect();
-
- if (is_hosted)
- {
- // we don't show the header when the floater is hosted, so reshape floater contents
- // to occupy the header space.
- contents_rect.mTop += getHeaderHeight();
- }
- else
- {
- // reduce the floater contents height by header height
- contents_rect.mTop -= getHeaderHeight();
- }
-
- floater_contents->setShape(contents_rect);
- }
+ const LLFloater::Params& default_params = LLFloater::getDefaultParams();
+ S32 floater_header_size = default_params.header_height;
+ LLView* floater_contents = getChild<LLView>("contents_view");
+
+ LLRect floater_rect = getLocalRect();
+ S32 top_border_of_contents = floater_rect.mTop - (is_hosted? 0 : floater_header_size);
+ LLRect handle_rect (0, floater_rect.mTop, floater_rect.mRight, top_border_of_contents);
+ LLRect contents_rect (0, top_border_of_contents, floater_rect.mRight, floater_rect.mBottom);
+ mDragHandle->setShape(handle_rect);
+ mDragHandle->setVisible(! is_hosted);
+ floater_contents->setShape(contents_rect);
}
void LLIMConversation::hideAllStandardButtons()