diff options
author | Oz Linden <oz@lindenlab.com> | 2010-11-04 16:27:38 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2010-11-04 16:27:38 -0400 |
commit | 124a59263184391b0b4ec418c532b7a715e9b5a3 (patch) | |
tree | 0206913c75ff29f0bc5c43304ae2c44219a14745 /indra/llui | |
parent | 889aff8d87a4dbf3ca43c43bdeed825f67fd5e60 (diff) | |
parent | 29283804ad75c89ca000337d03d8b32309254cef (diff) |
merging up latest changes from viewer-development
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llaccordionctrltab.cpp | 55 | ||||
-rw-r--r-- | indra/llui/llpanel.cpp | 2 |
2 files changed, 26 insertions, 31 deletions
diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 179b32098a..9d49c1a831 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -456,8 +456,7 @@ BOOL LLAccordionCtrlTab::handleMouseDown(S32 x, S32 y, MASK mask) { if(y >= (getRect().getHeight() - HEADER_HEIGHT) ) { - LLAccordionCtrlTabHeader* header = getChild<LLAccordionCtrlTabHeader>(DD_HEADER_NAME); - header->setFocus(true); + mHeader->setFocus(true); changeOpenClose(getDisplayChildren()); //reset stored state @@ -509,10 +508,9 @@ void LLAccordionCtrlTab::setAccordionView(LLView* panel) std::string LLAccordionCtrlTab::getTitle() const { - LLAccordionCtrlTabHeader* header = findChild<LLAccordionCtrlTabHeader>(DD_HEADER_NAME); - if (header) + if (mHeader) { - return header->getTitle(); + return mHeader->getTitle(); } else { @@ -522,57 +520,51 @@ std::string LLAccordionCtrlTab::getTitle() const void LLAccordionCtrlTab::setTitle(const std::string& title, const std::string& hl) { - LLAccordionCtrlTabHeader* header = findChild<LLAccordionCtrlTabHeader>(DD_HEADER_NAME); - if (header) + if (mHeader) { - header->setTitle(title, hl); + mHeader->setTitle(title, hl); } } void LLAccordionCtrlTab::setTitleFontStyle(std::string style) { - LLAccordionCtrlTabHeader* header = findChild<LLAccordionCtrlTabHeader>(DD_HEADER_NAME); - if (header) + if (mHeader) { - header->setTitleFontStyle(style); + mHeader->setTitleFontStyle(style); } } void LLAccordionCtrlTab::setTitleColor(LLUIColor color) { - LLAccordionCtrlTabHeader* header = findChild<LLAccordionCtrlTabHeader>(DD_HEADER_NAME); - if (header) + if (mHeader) { - header->setTitleColor(color); + mHeader->setTitleColor(color); } } boost::signals2::connection LLAccordionCtrlTab::setFocusReceivedCallback(const focus_signal_t::slot_type& cb) { - LLAccordionCtrlTabHeader* header = findChild<LLAccordionCtrlTabHeader>(DD_HEADER_NAME); - if (header) + if (mHeader) { - return header->setFocusReceivedCallback(cb); + return mHeader->setFocusReceivedCallback(cb); } return boost::signals2::connection(); } boost::signals2::connection LLAccordionCtrlTab::setFocusLostCallback(const focus_signal_t::slot_type& cb) { - LLAccordionCtrlTabHeader* header = findChild<LLAccordionCtrlTabHeader>(DD_HEADER_NAME); - if (header) + if (mHeader) { - return header->setFocusLostCallback(cb); + return mHeader->setFocusLostCallback(cb); } return boost::signals2::connection(); } void LLAccordionCtrlTab::setSelected(bool is_selected) { - LLAccordionCtrlTabHeader* header = findChild<LLAccordionCtrlTabHeader>(DD_HEADER_NAME); - if (header) + if (mHeader) { - header->setSelected(is_selected); + mHeader->setSelected(is_selected); } } @@ -776,8 +768,7 @@ S32 LLAccordionCtrlTab::notify(const LLSD& info) BOOL LLAccordionCtrlTab::handleKey(KEY key, MASK mask, BOOL called_from_parent) { - LLAccordionCtrlTabHeader* header = getChild<LLAccordionCtrlTabHeader>(DD_HEADER_NAME); - if( !header->hasFocus() ) + if( !mHeader->hasFocus() ) return LLUICtrl::handleKey(key, mask, called_from_parent); if ( (key == KEY_RETURN )&& mask == MASK_NONE) @@ -830,15 +821,19 @@ BOOL LLAccordionCtrlTab::handleKey(KEY key, MASK mask, BOOL called_from_parent) void LLAccordionCtrlTab::showAndFocusHeader() { - LLAccordionCtrlTabHeader* header = getChild<LLAccordionCtrlTabHeader>(DD_HEADER_NAME); - header->setFocus(true); - header->setSelected(mSelectionEnabled); + mHeader->setFocus(true); + mHeader->setSelected(mSelectionEnabled); LLRect screen_rc; - LLRect selected_rc = header->getRect(); + LLRect selected_rc = mHeader->getRect(); localRectToScreen(selected_rc, &screen_rc); - notifyParent(LLSD().with("scrollToShowRect",screen_rc.getValue())); + // This call to notifyParent() is intended to deliver "scrollToShowRect" command + // to the parent LLAccordionCtrl so by calling it from the direct parent of this + // accordion tab (assuming that the parent is an LLAccordionCtrl) the calls chain + // is shortened and messages from inside the collapsed tabs are avoided. + // See STORM-536. + getParent()->notifyParent(LLSD().with("scrollToShowRect",screen_rc.getValue())); } void LLAccordionCtrlTab::storeOpenCloseState() { diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index c8e56630f1..900e2c789e 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -904,7 +904,7 @@ LLPanel *LLPanel::childGetVisiblePanelWithHelp() child = *it; // do we have a panel with a help topic? LLPanel *panel = dynamic_cast<LLPanel *>(child); - if (panel && panel->getVisible() && !panel->getHelpTopic().empty()) + if (panel && panel->isInVisibleChain() && !panel->getHelpTopic().empty()) { return panel; } |