diff options
author | Paul Guslisty <pguslisty@productengine.com> | 2010-07-26 14:42:21 +0300 |
---|---|---|
committer | Paul Guslisty <pguslisty@productengine.com> | 2010-07-26 14:42:21 +0300 |
commit | bdacad23bbc01118592c8656ae7bd58356d26ed9 (patch) | |
tree | 53c6ab5819130206fd939edc5fed513ead80a9d9 /indra/llui | |
parent | 002bbd885b1e22db12229c3a8ffb6c4fdbfdfc5c (diff) |
EXT-7963 FIXED (Edit Outfit > Add More > Do not switch to next item type after add/replace)
- Added selected item type (in flat list view) as criterion when determining filter type in 'Add More' panel
- Fixed LLAccordionCtrl::getSelectedTab() method. When 'selection_enabled = false' for LLAccordionCtrlTab, LLAccordionCtrl::getSelectedTab() returned NULL, even if some accordion tab was selected. Now it's OK. Method returns currently selected LLAccordionCtrlTab.
Reviewed by Mike Antipov, Neal Orman and Richard Nelson at https://codereview.productengine.com/secondlife/r/790/
--HG--
branch : product-engine
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llaccordionctrl.cpp | 11 | ||||
-rw-r--r-- | indra/llui/llaccordionctrltab.cpp | 15 | ||||
-rw-r--r-- | indra/llui/llaccordionctrltab.h | 1 |
3 files changed, 25 insertions, 2 deletions
diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index 2bc8ea054a..c3ef734823 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -765,6 +765,17 @@ S32 LLAccordionCtrl::notifyParent(const LLSD& info) } return 0; } + else if(str_action == "deselect_current") + { + // Reset selection to the currently selected tab. + if (mSelectedTab) + { + mSelectedTab->setSelected(false); + mSelectedTab = NULL; + return 1; + } + return 0; + } } else if (info.has("scrollToShowRect")) { diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 37fc571bbd..d8760d5cdb 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -371,9 +371,11 @@ LLAccordionCtrlTab::LLAccordionCtrlTab(const LLAccordionCtrlTab::Params&p) mHeader = LLUICtrlFactory::create<LLAccordionCtrlTabHeader>(headerParams); addChild(mHeader, 1); - if (p.selection_enabled) + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLAccordionCtrlTab::selectOnFocusReceived, this)); + + if (!p.selection_enabled) { - LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLAccordionCtrlTab::selectOnFocusReceived, this)); + LLFocusableElement::setFocusLostCallback(boost::bind(&LLAccordionCtrlTab::deselectOnFocusLost, this)); } reshape(100, 200,FALSE); @@ -598,6 +600,15 @@ void LLAccordionCtrlTab::selectOnFocusReceived() getParent()->notifyParent(LLSD().with("action", "select_current")); } +void LLAccordionCtrlTab::deselectOnFocusLost() +{ + if(getParent()) // A parent may not be set if tabs are added dynamically. + { + getParent()->notifyParent(LLSD().with("action", "deselect_current")); + } + +} + S32 LLAccordionCtrlTab::getHeaderHeight() { return mHeaderVisible?HEADER_HEIGHT:0; diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index 5646a355d0..0ef9c407f1 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -220,6 +220,7 @@ protected: LLView* findContainerView (); void selectOnFocusReceived(); + void deselectOnFocusLost(); private: |