diff options
Diffstat (limited to 'indra/newview/llnearbychat.cpp')
-rw-r--r-- | indra/newview/llnearbychat.cpp | 81 |
1 files changed, 17 insertions, 64 deletions
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 03ebc344f1..3418462192 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -32,8 +32,9 @@ #include "llrootview.h" //#include "llchatitemscontainerctrl.h" #include "lliconctrl.h" -#include "llsidetray.h" +#include "llfloatersidepanelcontainer.h" #include "llfocusmgr.h" +#include "lllogchat.h" #include "llresizebar.h" #include "llresizehandle.h" #include "llmenugl.h" @@ -50,18 +51,19 @@ #include "lldraghandle.h" -#include "llbottomtray.h" #include "llnearbychatbar.h" #include "llfloaterreg.h" #include "lltrans.h" static const S32 RESIZE_BAR_THICKNESS = 3; -LLNearbyChat::LLNearbyChat(const LLSD& key) - : LLDockableFloater(NULL, false, false, key) + +static LLRegisterPanelClassWrapper<LLNearbyChat> t_panel_nearby_chat("panel_nearby_chat"); + +LLNearbyChat::LLNearbyChat() + : LLPanel() ,mChatHistory(NULL) { - } LLNearbyChat::~LLNearbyChat() @@ -86,54 +88,12 @@ BOOL LLNearbyChat::postBuild() mChatHistory = getChild<LLChatHistory>("chat_history"); - if(!LLDockableFloater::postBuild()) + if(!LLPanel::postBuild()) return false; - - if (getDockControl() == NULL) - { - setDockControl(new LLDockControl( - LLBottomTray::getInstance()->getNearbyChatBar(), this, - getDockTongue(), LLDockControl::TOP, boost::bind(&LLNearbyChat::getAllowedRect, this, _1))); - } - - //fix for EXT-4621 - //chrome="true" prevents floater from stilling capture - setIsChrome(true); - //chrome="true" hides floater caption - if (mDragHandle) - mDragHandle->setTitleVisible(TRUE); - + return true; } - -void LLNearbyChat::applySavedVariables() -{ - if (mRectControl.size() > 1) - { - const LLRect& rect = LLFloater::getControlGroup()->getRect(mRectControl); - if(!rect.isEmpty() && rect.isValid()) - { - reshape(rect.getWidth(), rect.getHeight()); - setRect(rect); - } - } - - - if(!LLFloater::getControlGroup()->controlExists(mDocStateControl)) - { - setDocked(true); - } - else - { - if (mDocStateControl.size() > 1) - { - bool dockState = LLFloater::getControlGroup()->getBOOL(mDocStateControl); - setDocked(dockState); - } - } -} - std::string appendTime() { time_t utc_time; @@ -203,7 +163,7 @@ void LLNearbyChat::onNearbySpeakers() { LLSD param; param["people_panel_tab_name"] = "nearby_panel"; - LLSideTray::getInstance()->showPanel("panel_people",param); + LLFloaterSidePanelContainer::showPanel("people", "panel_people", param); } @@ -229,18 +189,9 @@ void LLNearbyChat::setVisible(BOOL visible) } } - LLDockableFloater::setVisible(visible); + LLPanel::setVisible(visible); } -void LLNearbyChat::onOpen(const LLSD& key ) -{ - LLDockableFloater::onOpen(key); -} - -void LLNearbyChat::setRect (const LLRect &rect) -{ - LLDockableFloater::setRect(rect); -} void LLNearbyChat::getAllowedRect(LLRect& rect) { @@ -263,7 +214,8 @@ void LLNearbyChat::updateChatHistoryStyle() //static void LLNearbyChat::processChatHistoryStyleUpdate(const LLSD& newvalue) { - LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); + LLFloater* chat_bar = LLFloaterReg::getInstance("chat_bar"); + LLNearbyChat* nearby_chat = chat_bar->findChild<LLNearbyChat>("nearby_chat"); if(nearby_chat) nearby_chat->updateChatHistoryStyle(); } @@ -339,7 +291,8 @@ void LLNearbyChat::loadHistory() //static LLNearbyChat* LLNearbyChat::getInstance() { - return LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); + LLFloater* chat_bar = LLFloaterReg::getInstance("chat_bar"); + return chat_bar->findChild<LLNearbyChat>("nearby_chat"); } //////////////////////////////////////////////////////////////////////////////// @@ -367,7 +320,7 @@ BOOL LLNearbyChat::handleMouseDown(S32 x, S32 y, MASK mask) if(mChatHistory) mChatHistory->setFocus(TRUE); - return LLDockableFloater::handleMouseDown(x, y, mask); + return LLPanel::handleMouseDown(x, y, mask); } void LLNearbyChat::draw() @@ -380,5 +333,5 @@ void LLNearbyChat::draw() setTransparencyType(hasFocus() ? TT_ACTIVE : TT_INACTIVE); } - LLDockableFloater::draw(); + LLPanel::draw(); } |