From 68649fbf2b358dd9029d4f0c68e7edadb0dd3da0 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Wed, 19 Oct 2011 16:37:50 -0700 Subject: EXP-1420 Chat - Setting floater to minimized does not carry over to next opening of chat window --- indra/newview/llnearbychatbar.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'indra/newview/llnearbychatbar.cpp') diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 3e4228cfb6..f7840148ce 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -53,6 +53,8 @@ S32 LLNearbyChatBar::sLastSpecialChatChannel = 0; const S32 EXPANDED_HEIGHT = 300; +const S32 COLLAPSED_HEIGHT = 60; +const S32 EXPANDED_MIN_HEIGHT = 150; // legacy callback glue void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); @@ -102,7 +104,7 @@ BOOL LLNearbyChatBar::postBuild() // Register for font change notifications LLViewerChat::setFontChangedCallback(boost::bind(&LLNearbyChatBar::onChatFontChange, this, _1)); - mExpandedHeight = getMinHeight() + EXPANDED_HEIGHT; + mExpandedHeight = COLLAPSED_HEIGHT + EXPANDED_HEIGHT; enableResizeCtrls(true, true, false); @@ -113,11 +115,12 @@ bool LLNearbyChatBar::applyRectControl() { bool rect_controlled = LLFloater::applyRectControl(); - if (getRect().getHeight() > getMinHeight()) + if (getRect().getHeight() > COLLAPSED_HEIGHT) { getChildView("nearby_chat")->setVisible(true); mExpandedHeight = getRect().getHeight(); enableResizeCtrls(true); + setResizeLimits(getMinWidth(), EXPANDED_MIN_HEIGHT); } return rect_controlled; @@ -373,15 +376,19 @@ void LLNearbyChatBar::onToggleNearbyChatPanel() if (nearby_chat->getVisible()) { mExpandedHeight = getRect().getHeight(); + setResizeLimits(getMinWidth(), COLLAPSED_HEIGHT); nearby_chat->setVisible(FALSE); - reshape(getRect().getWidth(), getMinHeight()); + reshape(getRect().getWidth(), COLLAPSED_HEIGHT); enableResizeCtrls(true, true, false); + storeRectControl(); } else { nearby_chat->setVisible(TRUE); + setResizeLimits(getMinWidth(), EXPANDED_MIN_HEIGHT); reshape(getRect().getWidth(), mExpandedHeight); enableResizeCtrls(true); + storeRectControl(); } } -- cgit v1.2.3 From c8499a7b607171507df8cbb6f415dfaa66699b2a Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 19 Oct 2011 19:29:45 -0700 Subject: EXP-1419 : Fix the nearby chat window show/hide and height persistence within a session --- indra/newview/llnearbychatbar.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'indra/newview/llnearbychatbar.cpp') diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 3e4228cfb6..6a72bade67 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -112,14 +112,18 @@ BOOL LLNearbyChatBar::postBuild() bool LLNearbyChatBar::applyRectControl() { bool rect_controlled = LLFloater::applyRectControl(); - - if (getRect().getHeight() > getMinHeight()) + + LLView* nearby_chat = getChildView("nearby_chat"); + if (!nearby_chat->getVisible()) + { + reshape(getRect().getWidth(), getMinHeight()); + enableResizeCtrls(true, true, false); + } + else { - getChildView("nearby_chat")->setVisible(true); - mExpandedHeight = getRect().getHeight(); enableResizeCtrls(true); } - + return rect_controlled; } -- cgit v1.2.3