From b43771cad585cb9820941eb1b24b67390eaa9435 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Fri, 23 Oct 2009 17:20:45 +0000 Subject: Merging revisions 2156-2183 of https://svn.aws.productengine.com/secondlife/pe/stable-2 into P:\svn\viewer-2.0.0-3, respecting ancestry * Bugs: EXT-1590 EXT-1694 EXT-1660 EXT-1646 EXT-1694 EXT-1316 EXT-1775 EXT-1798 EXT-1799 EXT-1117 EXT-1571 EXT-1572 * Dev: EXT-1757 EXT-991 EXT-1758 EXT-1770 EXT-1192 EXT-1613 EXT-1611 EXT-1256 EXT-1758 EXT-747 --- indra/newview/llnearbychatbar.cpp | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'indra/newview/llnearbychatbar.cpp') diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 4f3bca50ff..5fa97926a5 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -203,7 +203,7 @@ BOOL LLNearbyChatBar::postBuild() mOutputMonitor = getChild("chat_zone_indicator"); mOutputMonitor->setVisible(FALSE); - mTalkBtn = getChild("talk"); + mTalkBtn = getParent()->getChild("talk"); // Speak button should be initially disabled because // it takes some time between logging in to world and connecting to voice channel. @@ -229,6 +229,16 @@ bool LLNearbyChatBar::instanceExists() void LLNearbyChatBar::draw() { + LLRect rect = getRect(); + S32 max_width = getMaxWidth(); + + if (rect.getWidth() > max_width) + { + rect.setLeftTopAndSize(rect.mLeft, rect.mTop, max_width, rect.getHeight()); + reshape(rect.getWidth(), rect.getHeight(), FALSE); + setRect(rect); + } + displaySpeakingIndicator(); LLPanel::draw(); } @@ -254,6 +264,32 @@ BOOL LLNearbyChatBar::handleKeyHere( KEY key, MASK mask ) return handled; } +S32 LLNearbyChatBar::getMinWidth() const +{ + static S32 min_width = -1; + + if (min_width < 0) + { + const std::string& s = getString("min_width"); + min_width = !s.empty() ? atoi(s.c_str()) : 300; + } + + return min_width; +} + +S32 LLNearbyChatBar::getMaxWidth() const +{ + static S32 max_width = -1; + + if (max_width < 0) + { + const std::string& s = getString("max_width"); + max_width = !s.empty() ? atoi(s.c_str()) : 510; + } + + return max_width; +} + BOOL LLNearbyChatBar::matchChatTypeTrigger(const std::string& in_str, std::string* out_str) { U32 in_len = in_str.length(); -- cgit v1.2.3