From 6008bf61b2d0475a274ad2b851b61e69496b5bf8 Mon Sep 17 00:00:00 2001
From: Sergei Litovchuk <slitovchuk@productengine.com>
Date: Sat, 26 Dec 2009 22:37:12 +0200
Subject: Fixed low bug EXT-2296 "View LM: Unnecessary green rectangle appears
 around title of LM after click on it" Fixed low bug EXT-2297 "View LM:
 Implement ellipsis for LM title"

--HG--
branch : product-engine
---
 indra/newview/llpanellandmarkinfo.cpp              | 28 ++++++++++++++--------
 indra/newview/llpanellandmarkinfo.h                |  3 ++-
 .../skins/default/xui/en/panel_landmark_info.xml   | 12 +++++++++-
 3 files changed, 31 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp
index 5de7c3f851..597b8bdb2d 100644
--- a/indra/newview/llpanellandmarkinfo.cpp
+++ b/indra/newview/llpanellandmarkinfo.cpp
@@ -81,7 +81,8 @@ BOOL LLPanelLandmarkInfo::postBuild()
 	mCreator = getChild<LLTextBox>("creator");
 	mCreated = getChild<LLTextBox>("created");
 
-	mTitleEditor = getChild<LLLineEditor>("title_editor");
+	mLandmarkTitle = getChild<LLTextBox>("title_value");
+	mLandmarkTitleEditor = getChild<LLLineEditor>("title_editor");
 	mNotesEditor = getChild<LLTextEditor>("notes_editor");
 	mFolderCombo = getChild<LLComboBox>("folder_combo");
 
@@ -101,7 +102,8 @@ void LLPanelLandmarkInfo::resetLocation()
 	mCreator->setText(not_available);
 	mOwner->setText(not_available);
 	mCreated->setText(not_available);
-	mTitleEditor->setText(LLStringUtil::null);
+	mLandmarkTitle->setText(LLStringUtil::null);
+	mLandmarkTitleEditor->setText(LLStringUtil::null);
 	mNotesEditor->setText(LLStringUtil::null);
 }
 
@@ -122,7 +124,8 @@ void LLPanelLandmarkInfo::setInfoType(INFO_TYPE type)
 		case CREATE_LANDMARK:
 			mCurrentTitle = getString("title_create_landmark");
 
-			mTitleEditor->setEnabled(TRUE);
+			mLandmarkTitle->setVisible(FALSE);
+			mLandmarkTitleEditor->setVisible(TRUE);
 			mNotesEditor->setEnabled(TRUE);
 		break;
 
@@ -130,7 +133,8 @@ void LLPanelLandmarkInfo::setInfoType(INFO_TYPE type)
 		default:
 			mCurrentTitle = getString("title_landmark");
 
-			mTitleEditor->setEnabled(FALSE);
+			mLandmarkTitle->setVisible(TRUE);
+			mLandmarkTitleEditor->setVisible(FALSE);
 			mNotesEditor->setEnabled(FALSE);
 		break;
 	}
@@ -185,12 +189,12 @@ void LLPanelLandmarkInfo::processParcelInfo(const LLParcelData& parcel_data)
 	{
 		if (parcel_data.name.empty())
 		{
-			mTitleEditor->setText(llformat("%s (%d, %d, %d)",
+			mLandmarkTitleEditor->setText(llformat("%s (%d, %d, %d)",
 								  parcel_data.sim_name.c_str(), region_x, region_y, region_z));
 		}
 		else
 		{
-			mTitleEditor->setText(parcel_data.name);
+			mLandmarkTitleEditor->setText(parcel_data.name);
 		}
 
 		std::string desc;
@@ -281,7 +285,8 @@ void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem)
 		mCreated->setText(timeStr);
 	}
 
-	mTitleEditor->setText(pItem->getName());
+	mLandmarkTitle->setText(pItem->getName());
+	mLandmarkTitleEditor->setText(pItem->getName());
 	mNotesEditor->setText(pItem->getDescription());
 }
 
@@ -296,11 +301,14 @@ void LLPanelLandmarkInfo::toggleLandmarkEditMode(BOOL enabled)
 	else
 	{
 		mTitle->setText(mCurrentTitle);
+
+		mLandmarkTitle->setText(mLandmarkTitleEditor->getText());
 	}
 
 	if (mNotesEditor->getReadOnly() ==  (enabled == TRUE))
 	{
-		mTitleEditor->setEnabled(enabled);
+		mLandmarkTitle->setVisible(!enabled);
+		mLandmarkTitleEditor->setVisible(enabled);
 		mNotesEditor->setReadOnly(!enabled);
 		mFolderCombo->setVisible(enabled);
 		getChild<LLTextBox>("folder_label")->setVisible(enabled);
@@ -313,7 +321,7 @@ void LLPanelLandmarkInfo::toggleLandmarkEditMode(BOOL enabled)
 
 const std::string& LLPanelLandmarkInfo::getLandmarkTitle() const
 {
-	return mTitleEditor->getText();
+	return mLandmarkTitleEditor->getText();
 }
 
 const std::string LLPanelLandmarkInfo::getLandmarkNotes() const
@@ -333,7 +341,7 @@ BOOL LLPanelLandmarkInfo::setLandmarkFolder(const LLUUID& id)
 
 void LLPanelLandmarkInfo::createLandmark(const LLUUID& folder_id)
 {
-	std::string name = mTitleEditor->getText();
+	std::string name = mLandmarkTitleEditor->getText();
 	std::string desc = mNotesEditor->getText();
 
 	LLStringUtil::trim(name);
diff --git a/indra/newview/llpanellandmarkinfo.h b/indra/newview/llpanellandmarkinfo.h
index 73e0ddb9cc..2a9949ae41 100644
--- a/indra/newview/llpanellandmarkinfo.h
+++ b/indra/newview/llpanellandmarkinfo.h
@@ -77,7 +77,8 @@ private:
 	LLTextBox*			mOwner;
 	LLTextBox*			mCreator;
 	LLTextBox*			mCreated;
-	LLLineEditor*		mTitleEditor;
+	LLTextBox*			mLandmarkTitle;
+	LLLineEditor*		mLandmarkTitleEditor;
 	LLTextEditor*		mNotesEditor;
 	LLComboBox*			mFolderCombo;
 };
diff --git a/indra/newview/skins/default/xui/en/panel_landmark_info.xml b/indra/newview/skins/default/xui/en/panel_landmark_info.xml
index 9f06e64560..744ee43f57 100644
--- a/indra/newview/skins/default/xui/en/panel_landmark_info.xml
+++ b/indra/newview/skins/default/xui/en/panel_landmark_info.xml
@@ -228,6 +228,16 @@
                  top_pad="10"
                  value="Title:"
                  width="290" />
+                <text
+                 follows="left|top"
+                 height="22"
+                 layout="topleft"
+                 left="0"
+                 name="title_value"
+                 text_color="white"
+                 top_pad="5"
+                 use_ellipses="true"
+                 width="290" /> 
                 <line_editor
                  background_image_disabled="task_panel_background.png"
                  follows="left|top|right"
@@ -238,7 +248,7 @@
                  name="title_editor"
                  prevalidate_callback="ascii"
                  text_readonly_color="white"
-                 top_pad="5"
+                 top_delta="0"
                  width="290" />
                 <text
                  follows="left|top"
-- 
cgit v1.2.3