From 553cf40d136e70f4819cb2b72d0483287db81b17 Mon Sep 17 00:00:00 2001
From: Dmitry Zaporozhan <dzaporozhan@productengine.com>
Date: Fri, 5 Feb 2010 12:25:18 +0200
Subject: [PATCH] Updated low bug EXT-4951 - Redundant edit box context menu in
 list items in Panel Picks/Classifieds. Reverted changeset 8956:930bef051fee.
 Added new parameter to control context menu visibility.

--HG--
branch : product-engine
---
 indra/llui/lltexteditor.cpp                               | 8 +++++---
 indra/llui/lltexteditor.h                                 | 7 ++++++-
 .../skins/default/xui/en/panel_classifieds_list_item.xml  | 2 +-
 .../newview/skins/default/xui/en/panel_pick_list_item.xml | 2 +-
 .../newview/skins/default/xui/en/widgets/text_editor.xml  | 3 ++-
 5 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 3fdb48b3ca7..ac5a0376fcb 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -242,7 +242,8 @@ LLTextEditor::Params::Params()
 	handle_edit_keys_directly("handle_edit_keys_directly", false),
 	show_line_numbers("show_line_numbers", false),
 	default_color("default_color"),
-    commit_on_focus_lost("commit_on_focus_lost", false)
+    commit_on_focus_lost("commit_on_focus_lost", false),
+	show_context_menu("show_context_menu")
 {}
 
 LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) :
@@ -258,7 +259,8 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) :
 	mMouseDownX(0),
 	mMouseDownY(0),
 	mTabsToNextField(p.ignore_tab),
-	mContextMenu(NULL)
+	mContextMenu(NULL),
+	mShowContextMenu(p.show_context_menu)
 {
 	mDefaultFont = p.font;
 
@@ -720,7 +722,7 @@ BOOL LLTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask)
 	}
 	if (!LLTextBase::handleRightMouseDown(x, y, mask))
 	{
-		if(getMouseOpaque())
+		if(getChowContextMenu())
 		{
 			showContextMenu(x, y);
 		}
diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h
index a136f9ccce7..d96198d9cee 100644
--- a/indra/llui/lltexteditor.h
+++ b/indra/llui/lltexteditor.h
@@ -68,7 +68,8 @@ class LLTextEditor :
 								ignore_tab,
 								handle_edit_keys_directly,
 								show_line_numbers,
-								commit_on_focus_lost;
+								commit_on_focus_lost,
+								show_context_menu;
 
 		//colors
 		Optional<LLUIColor>		default_color;
@@ -200,6 +201,9 @@ class LLTextEditor :
 	const LLTextSegmentPtr	getPreviousSegment() const;
 	void getSelectedSegments(segment_vec_t& segments) const;
 
+	void			setShowContextMenu(bool show) { mShowContextMenu = show; }
+	bool			getChowContextMenu() const { return mShowContextMenu; }
+
 protected:
 	void			showContextMenu(S32 x, S32 y);
 	void			drawPreeditMarker();
@@ -319,6 +323,7 @@ class LLTextEditor :
 	BOOL			mTakesFocus;
 
 	BOOL			mAllowEmbeddedItems;
+	bool			mShowContextMenu;
 
 	LLUUID			mSourceID;
 
diff --git a/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml b/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml
index 0c1418fc2d6..9518151b724 100644
--- a/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml
@@ -64,7 +64,7 @@
      layout="topleft"
      left="103"
      name="description"
-     textbox.mouse_opaque="false" 
+     textbox.show_context_menu="false" 
      top_pad="0"
      width="178"
      word_wrap="true" />
diff --git a/indra/newview/skins/default/xui/en/panel_pick_list_item.xml b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml
index e62c1278f92..9bcce1685e8 100644
--- a/indra/newview/skins/default/xui/en/panel_pick_list_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml
@@ -64,7 +64,7 @@
      layout="topleft"
      left="103"
      name="picture_descr"
-     textbox.mouse_opaque="false" 
+     textbox.show_context_menu="false" 
      top_pad="0"
      width="178"
      word_wrap="true" />
diff --git a/indra/newview/skins/default/xui/en/widgets/text_editor.xml b/indra/newview/skins/default/xui/en/widgets/text_editor.xml
index 23ca8ea3385..2ced8b1b4ba 100644
--- a/indra/newview/skins/default/xui/en/widgets/text_editor.xml
+++ b/indra/newview/skins/default/xui/en/widgets/text_editor.xml
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <!-- Core parameters are in simple_text_editor.xml -->
 <text_editor
-  allow_html="false"/>
+  allow_html="false"
+  show_context_menu="true"/>
-- 
GitLab