summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llcombobox.cpp8
-rw-r--r--indra/llui/llcombobox.h1
-rw-r--r--indra/llui/lllineeditor.cpp5
-rw-r--r--indra/llui/lllineeditor.h2
-rw-r--r--indra/llui/lltexteditor.cpp4
5 files changed, 18 insertions, 2 deletions
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index 559895da1a..00a933a0bb 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -845,6 +845,14 @@ void LLComboBox::setTextEntry(const LLStringExplicit& text)
}
}
+void LLComboBox::setKeystrokeOnEsc(BOOL enable)
+{
+ if (mTextEntry)
+ {
+ mTextEntry->setKeystrokeOnEsc(enable);
+ }
+}
+
void LLComboBox::onTextEntry(LLLineEditor* line_editor)
{
if (mTextEntryCallback != NULL)
diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h
index c9b1212b70..7d38c051a5 100644
--- a/indra/llui/llcombobox.h
+++ b/indra/llui/llcombobox.h
@@ -126,6 +126,7 @@ public:
virtual LLSD getValue() const;
void setTextEntry(const LLStringExplicit& text);
+ void setKeystrokeOnEsc(BOOL enable);
LLScrollListItem* add(const std::string& name, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); // add item "name" to menu
LLScrollListItem* add(const std::string& name, const LLUUID& id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE);
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index bd6b00d38b..cfab6b7fc8 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -125,6 +125,7 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p)
mTextLeftEdge(0), // computed in updateTextPadding() below
mTextRightEdge(0), // computed in updateTextPadding() below
mCommitOnFocusLost( p.commit_on_focus_lost ),
+ mKeystrokeOnEsc(FALSE),
mRevertOnEsc( p.revert_on_esc ),
mKeystrokeCallback( p.keystroke_callback() ),
mIsSelecting( FALSE ),
@@ -1494,6 +1495,10 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
{
setText(mPrevText);
// Note, don't set handled, still want to loose focus (won't commit becase text is now unchanged)
+ if (mKeystrokeOnEsc)
+ {
+ onKeystroke();
+ }
}
break;
diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h
index 88468503df..287837a15c 100644
--- a/indra/llui/lllineeditor.h
+++ b/indra/llui/lllineeditor.h
@@ -214,6 +214,7 @@ public:
void setCommitOnFocusLost( BOOL b ) { mCommitOnFocusLost = b; }
void setRevertOnEsc( BOOL b ) { mRevertOnEsc = b; }
+ void setKeystrokeOnEsc(BOOL b) { mKeystrokeOnEsc = b; }
void setCursorColor(const LLColor4& c) { mCursorColor = c; }
const LLColor4& getCursorColor() const { return mCursorColor.get(); }
@@ -338,6 +339,7 @@ protected:
BOOL mCommitOnFocusLost;
BOOL mRevertOnEsc;
+ BOOL mKeystrokeOnEsc;
keystroke_callback_t mKeystrokeCallback;
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 1a49b94c23..134b76c720 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -2493,11 +2493,11 @@ void LLTextEditor::updateLinkSegments()
}
}
}
-
+
// if the link's label (what the user can edit) is a valid Url,
// then update the link's HREF to be the same as the label text.
// This lets users edit Urls in-place.
- if (LLUrlRegistry::instance().hasUrl(url_label))
+ if (acceptsTextInput() && LLUrlRegistry::instance().hasUrl(url_label))
{
std::string new_url = wstring_to_utf8str(url_label);
LLStringUtil::trim(new_url);