diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2012-04-26 14:04:55 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2012-04-26 14:04:55 -0400 |
commit | 78f2663c4a61a7983c84cf50e5d2fdd92811a1b0 (patch) | |
tree | 56bf81cc39cb8c5180508c37c552c8ab23273300 /indra/newview/llnearbychatbar.cpp | |
parent | d6569db3520f7e0ce2d93febb6f4e26b48c08a3d (diff) | |
parent | 75c53a6a269890b9fe78b4b50d9b093a94778650 (diff) |
Automated merge with http://hg.secondlife.com/viewer-release
Diffstat (limited to 'indra/newview/llnearbychatbar.cpp')
-rw-r--r-- | indra/newview/llnearbychatbar.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index b4224e30e6..705046a517 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -103,15 +103,17 @@ BOOL LLNearbyChatBar::postBuild() mNearbyChat = getChildView("nearby_chat"); - LLUICtrl* show_btn = getChild<LLUICtrl>("show_nearby_chat"); + gSavedSettings.declareBOOL("nearbychat_history_visibility", mNearbyChat->getVisible(), "Visibility state of nearby chat history", TRUE); + BOOL show_nearby_chat = gSavedSettings.getBOOL("nearbychat_history_visibility"); + + LLButton* show_btn = getChild<LLButton>("show_nearby_chat"); show_btn->setCommitCallback(boost::bind(&LLNearbyChatBar::onToggleNearbyChatPanel, this)); + show_btn->setToggleState(show_nearby_chat); mOutputMonitor = getChild<LLOutputMonitorCtrl>("chat_zone_indicator"); mOutputMonitor->setVisible(FALSE); - gSavedSettings.declareBOOL("nearbychat_history_visibility", mNearbyChat->getVisible(), "Visibility state of nearby chat history", TRUE); - - mNearbyChat->setVisible(gSavedSettings.getBOOL("nearbychat_history_visibility")); + showNearbyChatPanel(show_nearby_chat); // Register for font change notifications LLViewerChat::setFontChangedCallback(boost::bind(&LLNearbyChatBar::onChatFontChange, this, _1)); @@ -392,26 +394,23 @@ void LLNearbyChatBar::sendChat( EChatType type ) } } - -void LLNearbyChatBar::onToggleNearbyChatPanel() +void LLNearbyChatBar::showNearbyChatPanel(bool show) { - LLView* nearby_chat = getChildView("nearby_chat"); - - if (nearby_chat->getVisible()) + if (!show) { - if (!isMinimized()) + if (mNearbyChat->getVisible() && !isMinimized()) { mExpandedHeight = getRect().getHeight(); } setResizeLimits(getMinWidth(), COLLAPSED_HEIGHT); - nearby_chat->setVisible(FALSE); + mNearbyChat->setVisible(FALSE); reshape(getRect().getWidth(), COLLAPSED_HEIGHT); enableResizeCtrls(true, true, false); storeRectControl(); } else { - nearby_chat->setVisible(TRUE); + mNearbyChat->setVisible(TRUE); setResizeLimits(getMinWidth(), EXPANDED_MIN_HEIGHT); reshape(getRect().getWidth(), mExpandedHeight); enableResizeCtrls(true); @@ -421,6 +420,11 @@ void LLNearbyChatBar::onToggleNearbyChatPanel() gSavedSettings.setBOOL("nearbychat_history_visibility", mNearbyChat->getVisible()); } +void LLNearbyChatBar::onToggleNearbyChatPanel() +{ + showNearbyChatPanel(!mNearbyChat->getVisible()); +} + void LLNearbyChatBar::setMinimized(BOOL b) { LLNearbyChat* nearby_chat = getChild<LLNearbyChat>("nearby_chat"); |