summaryrefslogtreecommitdiff
path: root/indra/newview/llnearbychatbar.cpp
diff options
context:
space:
mode:
authorrichard <none@none>2009-10-26 14:28:09 -0700
committerrichard <none@none>2009-10-26 14:28:09 -0700
commitf2a48ed7f9c67ecc15b9174dc08069da25b33380 (patch)
tree265af2b431939a8ff88db532b7de3b3396437c5b /indra/newview/llnearbychatbar.cpp
parent977dd845346cae05eab2249945f083df47552c8f (diff)
parente84ff39e4c7c5b028a6b8b4f6dc5d37c525eb1c4 (diff)
merge
Diffstat (limited to 'indra/newview/llnearbychatbar.cpp')
-rw-r--r--indra/newview/llnearbychatbar.cpp38
1 files changed, 37 insertions, 1 deletions
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<LLOutputMonitorCtrl>("chat_zone_indicator");
mOutputMonitor->setVisible(FALSE);
- mTalkBtn = getChild<LLTalkButton>("talk");
+ mTalkBtn = getParent()->getChild<LLTalkButton>("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();