From 0c528df35ed6d7ecf6b847983f842aa38ef1636a Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Mon, 23 Jan 2012 20:17:38 +0200
Subject: [PATCH] EXP-1671 FIXED Hide "Translate chat" checkbox when
 translation is not configured.

---
 .../newview/llfloatertranslationsettings.cpp  |  2 +-
 indra/newview/llnearbychatbar.cpp             |  6 +-
 indra/newview/llnearbychatbar.h               |  2 +-
 .../default/xui/en/panel_nearby_chat.xml      | 84 ++++++++++++-------
 4 files changed, 61 insertions(+), 33 deletions(-)

diff --git a/indra/newview/llfloatertranslationsettings.cpp b/indra/newview/llfloatertranslationsettings.cpp
index 428a02e9f05..1a17183efdd 100644
--- a/indra/newview/llfloatertranslationsettings.cpp
+++ b/indra/newview/llfloatertranslationsettings.cpp
@@ -293,6 +293,6 @@ void LLFloaterTranslationSettings::onBtnOK()
 	gSavedSettings.setString("TranslationService", getSelectedService());
 	gSavedSettings.setString("BingTranslateAPIKey", getEnteredBingKey());
 	gSavedSettings.setString("GoogleTranslateAPIKey", getEnteredGoogleKey());
-	LLNearbyChatBar::getInstance()->enableTranslationCheckbox(LLTranslate::isTranslationConfigured());
+	LLNearbyChatBar::getInstance()->showTranslationCheckbox(LLTranslate::isTranslationConfigured());
 	closeFloater(false);
 }
diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp
index 4512c14b7a8..b4224e30e68 100644
--- a/indra/newview/llnearbychatbar.cpp
+++ b/indra/newview/llnearbychatbar.cpp
@@ -124,7 +124,7 @@ BOOL LLNearbyChatBar::postBuild()
 // virtual
 void LLNearbyChatBar::onOpen(const LLSD& key)
 {
-	enableTranslationCheckbox(LLTranslate::isTranslationConfigured());
+	showTranslationCheckbox(LLTranslate::isTranslationConfigured());
 }
 
 bool LLNearbyChatBar::applyRectControl()
@@ -170,9 +170,9 @@ void LLNearbyChatBar::showHistory()
 	}
 }
 
-void LLNearbyChatBar::enableTranslationCheckbox(BOOL enable)
+void LLNearbyChatBar::showTranslationCheckbox(BOOL show)
 {
-	getChild<LLUICtrl>("translate_chat_checkbox")->setEnabled(enable);
+	getChild<LLUICtrl>("translate_chat_checkbox_lp")->setVisible(show);
 }
 
 void LLNearbyChatBar::draw()
diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h
index baf12a06ea0..8547cf0bced 100644
--- a/indra/newview/llnearbychatbar.h
+++ b/indra/newview/llnearbychatbar.h
@@ -61,7 +61,7 @@ class LLNearbyChatBar :	public LLFloater
 	static void sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate);
 
 	void showHistory();
-	void enableTranslationCheckbox(BOOL enable);
+	void showTranslationCheckbox(BOOL show);
 	/*virtual*/void setMinimized(BOOL b);
 
 protected:
diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat.xml
index d492f9bd68b..6cfd929bc0c 100644
--- a/indra/newview/skins/default/xui/en/panel_nearby_chat.xml
+++ b/indra/newview/skins/default/xui/en/panel_nearby_chat.xml
@@ -1,35 +1,63 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel
- height="300"
  follows="all"
+ height="300"
+ help_topic="nearby_chat"
  layout="topleft"
  name="nearby_chat"
- help_topic="nearby_chat"
  width="320">
-            <check_box
-             bottom_delta="36"
-             control_name="TranslateChat"
-             enabled="true"
-             height="16"
-             label="Translate chat"
-             layout="topleft"
-             left="5"
-             name="translate_chat_checkbox"
-             width="230" />
-  <chat_history
-    parse_urls="true"
-    bg_readonly_color="ChatHistoryBgColor"
-    bg_writeable_color="ChatHistoryBgColor"
-    follows="all"
-    left="5"
-    top_delta="17"
-    layout="topleft"
-    height="260"
-    name="chat_history"
-    parse_highlights="true"
-    text_color="ChatHistoryTextColor"
-    text_readonly_color="ChatHistoryTextColor"
-    right_widget_pad="5"
-    left_widget_pad="0"
-    width="315" />
+  <layout_stack
+   follows="left|top|right"
+   height="295"
+   layout="topleft"
+   left="0"
+   name="stack"
+   top="5"
+   orientation="vertical"
+   width="320">
+    <layout_panel
+     auto_resize="false"
+     height="26"
+     layout="topleft"
+     left_delta="0"
+     name="translate_chat_checkbox_lp"
+     top_delta="0"
+     visible="true"
+     width="313">
+      <check_box
+       top="10"
+       control_name="TranslateChat"
+       enabled="true"
+       height="16"
+       label="Translate chat"
+       layout="topleft"
+       left="5"
+       name="translate_chat_checkbox"
+       width="300" />
+    </layout_panel>
+    <layout_panel
+     auto_resize="true"
+     height="277"
+     left_delta="0"
+     layout="topleft"
+     name="chat_history_lp"
+     width="318">
+      <chat_history
+       bg_readonly_color="ChatHistoryBgColor"
+       bg_writeable_color="ChatHistoryBgColor"
+       follows="all"
+       layout="topleft"
+       left="5"
+       left_widget_pad="0"
+       height="272"
+       name="chat_history"
+       parse_highlights="true"
+       parse_urls="true"
+       right_widget_pad="5"
+       text_color="ChatHistoryTextColor"
+       text_readonly_color="ChatHistoryTextColor"
+       top="0"
+       width="313" />
+    </layout_panel>
+  </layout_stack>
 </panel>
-- 
GitLab