diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llnearbychat.cpp | 37 | ||||
-rw-r--r-- | indra/newview/llnearbychat.h | 7 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml | 6 |
3 files changed, 36 insertions, 14 deletions
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 12638ab855..81d033d7f9 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -97,14 +97,39 @@ BOOL LLNearbyChat::postBuild() if (getDockControl() == NULL) { setDockControl(new LLDockControl( - LLBottomTray::getInstance()->getNearbyChatBar(), this, - getDockTongue(), LLDockControl::LEFT, boost::bind(&LLNearbyChat::getAllowedRect, this, _1))); + LLBottomTray::getInstance()->getNearbyChatBar(), this, + getDockTongue(), LLDockControl::LEFT, boost::bind(&LLNearbyChat::getAllowedRect, this, _1))); } return true; } +void LLNearbyChat::applySavedVariables() +{ + + if (mRectControl.size() > 1) + { + const LLRect& rect = LLUI::sSettingGroups["floater"]->getRect(mRectControl); + reshape(rect.getWidth(), rect.getHeight()); + setRect(rect); + } + + + if(!LLUI::sSettingGroups["floater"]->controlExists(mDocStateControl)) + { + setDocked(true); + } + else + { + if (mDocStateControl.size() > 1) + { + bool dockState = LLUI::sSettingGroups["floater"]->getBOOL(mDocStateControl); + setDocked(dockState); + } + } +} + LLColor4 nearbychat_get_text_color(const LLChat& chat) { LLColor4 text_color; @@ -265,11 +290,5 @@ void LLNearbyChat::getAllowedRect(LLRect& rect) { rect = gViewerWindow->getWorldViewRect(); } -void LLNearbyChat::setVisible (BOOL visible) -{ - LLDockableFloater::setVisible(visible); -} -void LLNearbyChat::toggleWindow() -{ -} + diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h index 20cbf7537d..cb4654654a 100644 --- a/indra/newview/llnearbychat.h +++ b/indra/newview/llnearbychat.h @@ -52,16 +52,15 @@ public: void onNearbyChatContextMenuItemClicked(const LLSD& userdata); bool onNearbyChatCheckContextMenuItem(const LLSD& userdata); - void setDocked (bool docked, bool pop_on_undock); - void toggleWindow (); + void setDocked (bool docked, bool pop_on_undock = true); /*virtual*/ void onOpen (const LLSD& key); - virtual void setVisible (BOOL visible); - virtual void setRect (const LLRect &rect); private: + virtual void applySavedVariables(); + void getAllowedRect (LLRect& rect); void onNearbySpeakers (); diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml index 2182163da5..555fedb1ff 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml @@ -42,13 +42,17 @@ width="20" /> <button follows="right" + is_toggle="true" width="45" top="0" layout="topleft" left_pad="8" label="Log" height="23" + name="show_nearby_chat" tool_tip="Show/hide nearby chat log"> - <button.commit_callback function="Floater.Toggle" parameter="nearby_chat"/> + <button.init_callback + function="Button.SetDockableFloaterToggle" + parameter="nearby_chat" /> </button> </panel> |