From 49bcff0e5ef9812658fc577689b2bf4f6563f4c4 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sat, 12 Nov 2011 17:19:33 +0100 Subject: [PATCH] - fixed : chat toasts aren't visible when the chat history is collapsed after the latest merge -> panel_nearby_chat contains the nearby_chat control -> when we toggle the chat history LL toggles the visibility of nearby_chat while we toggle panel_nearby_chat's visibility -> if panel_nearby_chat is invisible, nearby_chat's getVisible() still returns TRUE => LL code will act as if the chat history is visible --HG-- branch : Chat-NearbyChat --- indra/newview/llnearbychatbar.cpp | 40 ++++++++++++++++++++++++------- indra/newview/llnearbychatbar.h | 4 ++++ 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 591213136b..ea9684430d 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -92,6 +92,8 @@ LLNearbyChatBar::LLNearbyChatBar(const LLSD& key) : LLFloater(key), // mChatBox(NULL) // [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-10-26 (Catznip-3.2.0a) | Added: Catznip-3.2.0a + mNearbyChatContainer(NULL), + mNearbyChat(NULL), mChatBarImpl(NULL) // [/SL:KB] { @@ -148,6 +150,9 @@ BOOL LLNearbyChatBarSingle::postBuild() // [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-10-26 (Catznip-3.2.0a) | Added: Catznip-3.2.0a BOOL LLNearbyChatBar::postBuild() { + mNearbyChatContainer = findChild("panel_nearby_chat"); + mNearbyChat = findChild("nearby_chat"); + mChatBarImpl = (hasChild("panel_chat_bar_multi")) ? findChild("panel_chat_bar_multi") : findChild("panel_chat_bar_single"); LLUICtrl* show_btn = getChild("show_nearby_chat"); @@ -170,7 +175,7 @@ BOOL LLNearbyChatBar::postBuild() LLIMFloaterContainer* pConvFloater = LLIMFloaterContainer::getInstance(); if (pConvFloater) { - if (!getChildView("nearby_chat")->getVisible()) + if (!mNearbyChatContainer->getVisible()) onToggleNearbyChatPanel(); pConvFloater->LLMultiFloater::addFloater(this, TRUE, LLTabContainer::START); } @@ -191,7 +196,10 @@ bool LLNearbyChatBar::applyRectControl() bool rect_controlled = LLFloater::applyRectControl(); - LLView* nearby_chat = getChildView("nearby_chat"); +// LLView* nearby_chat = getChildView("nearby_chat"); +// [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-11-12 (Catznip-3.2.0a) | Added: Catznip-3.2.0a + LLView* nearby_chat = mNearbyChatContainer; +// [/SL:KB] if (!nearby_chat->getVisible()) { reshape(getRect().getWidth(), getMinHeight()); @@ -203,7 +211,7 @@ bool LLNearbyChatBar::applyRectControl() setResizeLimits(getMinWidth(), EXPANDED_MIN_HEIGHT); } // [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-10-26 (Catznip-3.2.0a) | Added: Catznip-3.2.0a - getChildView("panel_nearby_chat")->setVisible(mExpandedHeight > COLLAPSED_HEIGHT); + mNearbyChatContainer->setVisible(mExpandedHeight > COLLAPSED_HEIGHT); // [/SL:KB] return rect_controlled; @@ -231,7 +239,10 @@ void LLNearbyChatBar::showHistory() { openFloater(); - if (!getChildView("nearby_chat")->getVisible()) +// if (!getChildView("nearby_chat")->getVisible()) +// [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-11-12 (Catznip-3.2.0a) | Added: Catznip-3.2.0a + if (!mNearbyChatContainer->getVisible()) +// [/SL:KB] { onToggleNearbyChatPanel(); } @@ -547,7 +558,7 @@ void LLNearbyChatBar::onToggleNearbyChatPanel() { // LLView* nearby_chat = getChildView("nearby_chat"); // [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-10-26 (Catznip-3.2.0a) | Added: Catznip-3.2.0a - LLView* nearby_chat = getChildView("panel_nearby_chat"); + LLView* nearby_chat = mNearbyChatContainer; // [/SL:KB] if (nearby_chat->getVisible()) @@ -572,16 +583,27 @@ void LLNearbyChatBar::onToggleNearbyChatPanel() } } +//void LLNearbyChatBar::setMinimized(BOOL b) +//{ +// LLNearbyChat* nearby_chat = getChild("nearby_chat"); +// // when unminimizing with nearby chat visible, go ahead and kill off screen chats +// if (!b && nearby_chat->getVisible()) +// { +// nearby_chat->removeScreenChat(); +// } +// LLFloater::setMinimized(b); +//} +// [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-11-12 (Catznip-3.2.0a) | Added: Catznip-3.2.0a void LLNearbyChatBar::setMinimized(BOOL b) { - LLNearbyChat* nearby_chat = getChild("nearby_chat"); - // when unminimizing with nearby chat visible, go ahead and kill off screen chats - if (!b && nearby_chat->getVisible()) + // When unminimizing with nearby chat visible, go ahead and kill off screen chats + if ( (isMinimized() != b) && (!b) && (mNearbyChatContainer->getVisible()) ) { - nearby_chat->removeScreenChat(); + mNearbyChat->removeScreenChat(); } LLFloater::setMinimized(b); } +// [/SL:KB] //void LLNearbyChatBar::onChatBoxCommit() // [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-10-26 (Catznip-3.2.0a) | Added: Catznip-3.2.0a diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index 05f653b6e2..3456b7f4fe 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -36,6 +36,8 @@ #include "llspeakers.h" // [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-08-20 (Catznip-3.2.0a) #include "llnearbychatbarbase.h" + +class LLNearbyChat; // [/SL:KB] // [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-10-26 (Catznip-3.2.0a) | Added: Catznip-3.2.0a @@ -135,6 +137,8 @@ protected: // LLOutputMonitorCtrl* mOutputMonitor; // LLLocalSpeakerMgr* mSpeakerMgr; // [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-10-26 (Catznip-3.2.0a) | Added: Catznip-3.2.0a + LLPanel* mNearbyChatContainer; // "panel_nearby_chat" is the parent panel containing "nearby_chat" + LLNearbyChat* mNearbyChat; // "nearby_chat" LLNearbyChatBarBase* mChatBarImpl; // [/SL:KB]