From 7bd45ab3622f27e0a424eb61f2682e82439ec9e6 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 19 Jan 2015 13:09:24 +0200 Subject: MAINT-4790 WIP Show focused background image for login text fields. --- indra/llui/lllineeditor.cpp | 4 +++- indra/llui/lllineeditor.h | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 45f4272aa7..9919ec3ba5 100755 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -88,6 +88,7 @@ LLLineEditor::Params::Params() background_image("background_image"), background_image_disabled("background_image_disabled"), background_image_focused("background_image_focused"), + bg_image_always_focused("bg_image_always_focused", false), select_on_focus("select_on_focus", false), revert_on_esc("revert_on_esc", true), spellcheck("spellcheck", false), @@ -147,6 +148,7 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p) mBgImage( p.background_image ), mBgImageDisabled( p.background_image_disabled ), mBgImageFocused( p.background_image_focused ), + mShowImageFocused( p.bg_image_always_focused ), mHaveHistory(FALSE), mReplaceNewlinesWithSpaces( TRUE ), mLabel(p.label), @@ -1675,7 +1677,7 @@ void LLLineEditor::drawBackground() { image = mBgImageDisabled; } - else if ( has_focus ) + else if ( has_focus || mShowImageFocused) { image = mBgImageFocused; } diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 40f931ecc1..c6d472f59b 100755 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -90,6 +90,7 @@ public: spellcheck, commit_on_focus_lost, ignore_tab, + bg_image_always_focused, is_password; // colors @@ -375,6 +376,8 @@ protected: BOOL mReadOnly; + BOOL mShowImageFocused; + LLWString mPreeditWString; LLWString mPreeditOverwrittenWString; std::vector mPreeditPositions; -- cgit v1.2.3 From cccdd1fb397240fda99663b403e00b2582c202ba Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Fri, 30 Jan 2015 15:36:00 +0200 Subject: MAINT-4853 FIXED Pressing the ENTER key when entering a location into the Type a location field, doesn't log you in --- indra/llui/llcombobox.cpp | 5 +++++ indra/llui/llcombobox.h | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index 56be52f69a..b32aea5ffa 100755 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -788,6 +788,11 @@ BOOL LLComboBox::handleKeyHere(KEY key, MASK mask) // since the dropdown button eats the key if (key == KEY_RETURN) { + if (mask == MASK_NONE) + { + mOnReturnSignal(this, getValue()); + } + // don't show list and don't eat key input when committing // free-form text entry with RETURN since user already knows // what they are trying to select diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h index 67393504e7..c9b1212b70 100755 --- a/indra/llui/llcombobox.h +++ b/indra/llui/llcombobox.h @@ -199,6 +199,11 @@ public: void setTextEntryCallback( commit_callback_t cb ) { mTextEntryCallback = cb; } void setTextChangedCallback( commit_callback_t cb ) { mTextChangedCallback = cb; } + /** + * Connects callback to signal called when Return key is pressed. + */ + boost::signals2::connection setReturnCallback( const commit_signal_t::slot_type& cb ) { return mOnReturnSignal.connect(cb); } + void setButtonVisible(BOOL visible); void onButtonMouseDown(); @@ -231,6 +236,7 @@ private: commit_callback_t mTextChangedCallback; commit_callback_t mSelectionCallback; boost::signals2::connection mTopLostSignalConnection; + commit_signal_t mOnReturnSignal; S32 mLastSelectedIndex; }; -- cgit v1.2.3