diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/lllineeditor.h | 2 | ||||
-rw-r--r-- | indra/newview/llsearchcombobox.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llsearchcombobox.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/search_editor.xml | 4 |
4 files changed, 24 insertions, 1 deletions
diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index a024f48cc6..339aad30fb 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -189,6 +189,7 @@ public: // Selects characters 'start' to 'end'. void setSelection(S32 start, S32 end); + virtual void getSelectionRange(S32 *position, S32 *length) const; void setCommitOnFocusLost( BOOL b ) { mCommitOnFocusLost = b; } void setRevertOnEsc( BOOL b ) { mRevertOnEsc = b; } @@ -277,7 +278,6 @@ private: const segment_lengths_t &preedit_segment_lengths, const standouts_t &preedit_standouts, S32 caret_position); virtual void markAsPreedit(S32 position, S32 length); virtual void getPreeditRange(S32 *position, S32 *length) const; - virtual void getSelectionRange(S32 *position, S32 *length) const; virtual BOOL getPreeditLocation(S32 query_position, LLCoordGL *coord, LLRect *bounds, LLRect *control) const; virtual S32 getPreeditFontSize() const; diff --git a/indra/newview/llsearchcombobox.cpp b/indra/newview/llsearchcombobox.cpp index ab5536a12d..33efae50ae 100644 --- a/indra/newview/llsearchcombobox.cpp +++ b/indra/newview/llsearchcombobox.cpp @@ -187,6 +187,23 @@ void LLSearchComboBox::clearHistory() setTextEntry(LLStringUtil::null); } +BOOL LLSearchComboBox::handleKeyHere(KEY key,MASK mask ) +{ + if(mTextEntry->hasFocus() && MASK_NONE == mask && KEY_DOWN == key) + { + S32 first = 0; + S32 size = 0; + + // get entered text (without auto-complete part) + mTextEntry->getSelectionRange(&first, &size); + std::string search_query = mTextEntry->getText(); + search_query.erase(first, size); + + onSearchPrearrange(search_query); + } + return LLComboBox::handleKeyHere(key, mask); +} + LLSearchHistoryBuilder::LLSearchHistoryBuilder(LLSearchComboBox* combo_box, const std::string& filter) : mComboBox(combo_box) , mFilter(filter) diff --git a/indra/newview/llsearchcombobox.h b/indra/newview/llsearchcombobox.h index 38f9a5a26b..c23ebc8923 100644 --- a/indra/newview/llsearchcombobox.h +++ b/indra/newview/llsearchcombobox.h @@ -63,6 +63,8 @@ public: */ void clearHistory(); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + ~LLSearchComboBox(); protected: diff --git a/indra/newview/skins/default/xui/en/widgets/search_editor.xml b/indra/newview/skins/default/xui/en/widgets/search_editor.xml index 15b23ea9b3..8643f919ec 100644 --- a/indra/newview/skins/default/xui/en/widgets/search_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/search_editor.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <search_editor + clear_button_visible="false" text_pad_left="4" select_on_focus="true" background_image="TextField_Search_Off" @@ -12,4 +13,7 @@ height="13" image_unselected="Search" image_selected="Search" /> + <clear_button label="" + image_unselected="Icon_Close_Foreground" + image_selected="Icon_Close_Press" /> </search_editor> |