From b6b463dd3927148d1bb20f0bb9aa624ddaed15c4 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 1 Nov 2011 15:30:54 -0700 Subject: EXP-1452 FIX minimum height of NEARBY CHAT window can be circumvented by minimizing it. --- indra/newview/llnearbychat.cpp | 25 +++++++++++++------------ indra/newview/llnearbychat.h | 6 +++--- indra/newview/llnearbychatbar.cpp | 9 ++++++--- 3 files changed, 22 insertions(+), 18 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 3418462192..a7303ad035 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -60,13 +60,9 @@ static const S32 RESIZE_BAR_THICKNESS = 3; static LLRegisterPanelClassWrapper t_panel_nearby_chat("panel_nearby_chat"); -LLNearbyChat::LLNearbyChat() - : LLPanel() - ,mChatHistory(NULL) -{ -} - -LLNearbyChat::~LLNearbyChat() +LLNearbyChat::LLNearbyChat(const LLNearbyChat::Params& p) +: LLPanel(p), + mChatHistory(NULL) { } @@ -178,15 +174,20 @@ bool LLNearbyChat::onNearbyChatCheckContextMenuItem(const LLSD& userdata) return false; } +void LLNearbyChat::removeScreenChat() +{ + LLNotificationsUI::LLScreenChannelBase* chat_channel = LLNotificationsUI::LLChannelManager::getInstance()->findChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))); + if(chat_channel) + { + chat_channel->removeToastsFromChannel(); + } +} + void LLNearbyChat::setVisible(BOOL visible) { if(visible) { - LLNotificationsUI::LLScreenChannelBase* chat_channel = LLNotificationsUI::LLChannelManager::getInstance()->findChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))); - if(chat_channel) - { - chat_channel->removeToastsFromChannel(); - } + removeScreenChat(); } LLPanel::setVisible(visible); diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h index 5ef584c8ff..7c5975cbc5 100644 --- a/indra/newview/llnearbychat.h +++ b/indra/newview/llnearbychat.h @@ -37,8 +37,7 @@ class LLChatHistory; class LLNearbyChat: public LLPanel { public: - LLNearbyChat(); - ~LLNearbyChat(); + LLNearbyChat(const Params& p = LLPanel::getDefaultParams()); BOOL postBuild (); @@ -63,13 +62,14 @@ public: void loadHistory(); static LLNearbyChat* getInstance(); + void removeScreenChat(); private: void getAllowedRect (LLRect& rect); void onNearbySpeakers (); - + private: LLHandle mPopupMenuHandle; diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 4674c85324..c612b14256 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -47,6 +47,7 @@ #include "llviewerwindow.h" #include "llrootview.h" #include "llviewerchat.h" +#include "llnearbychat.h" #include "llresizehandle.h" @@ -401,11 +402,13 @@ void LLNearbyChatBar::onToggleNearbyChatPanel() void LLNearbyChatBar::setMinimized(BOOL b) { - if (b != LLFloater::isMinimized()) + LLNearbyChat* nearby_chat = getChild("nearby_chat"); + // when unminimizing with nearby chat visible, go ahead and kill off screen chats + if (!b && nearby_chat->getVisible()) { - LLFloater::setMinimized(b); - getChildView("nearby_chat")->setVisible(!b); + nearby_chat->removeScreenChat(); } + LLFloater::setMinimized(b); } void LLNearbyChatBar::onChatBoxCommit() -- cgit v1.2.3