diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-07-27 10:46:53 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-07-27 10:46:53 +0100 |
commit | bd8b1d837735ba090fed1572920a612c7005ecb0 (patch) | |
tree | 00946ca3c53f61befcd5d25c1c8aab3c3e68cf93 /indra/llui | |
parent | e543691aec8ad19762d6216dd53466d1d42ced1a (diff) | |
parent | e1effcb285c8072601e5148101293e6702128fdd (diff) |
slightly-hairy merge from viewer-release
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 0cccd4e6de..87ff39575a 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -372,9 +372,11 @@ LLAccordionCtrlTab::LLAccordionCtrlTab(const LLAccordionCtrlTab::Params&p) mHeader = LLUICtrlFactory::create<LLAccordionCtrlTabHeader>(headerParams); addChild(mHeader, 1); - if (mSelectionEnabled) + 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); @@ -599,6 +601,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 1344ce0a30..00fb276f19 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -220,6 +220,7 @@ protected: LLView* findContainerView (); void selectOnFocusReceived(); + void deselectOnFocusLost(); private: |