From 8b33f3df149d49f3d627635581a276a69fa65d32 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 20 Aug 2020 10:46:31 +0200 Subject: [PATCH] Revert half-implemented "SL-11172 Scroll to focused object if object is not in visible area" that sneaked in during the transition to Git (will be fully implemented in DRTVWR-503) This reverts commit 941c1ee7f8a0446937c37ba6ce31503a0c360d50. --- indra/llui/llaccordionctrl.cpp | 31 ------------------------------- indra/llui/llaccordionctrl.h | 1 - indra/llui/llaccordionctrltab.cpp | 29 ----------------------------- indra/llui/llaccordionctrltab.h | 1 - indra/llui/lluictrl.cpp | 1 - indra/llui/llview.cpp | 10 ---------- indra/llui/llview.h | 1 - 7 files changed, 74 deletions(-) diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index 938cb5f5ce..42ab9b87dd 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -666,37 +666,6 @@ void LLAccordionCtrl::onScrollPosChangeCallback(S32, LLScrollbar*) { updateLayout(getRect().getWidth(),getRect().getHeight()); } - -// virtual -void LLAccordionCtrl::onChildGotFocus(const LLUICtrl *cntrl) -{ - if (mScrollbar && mScrollbar->getVisible()) - { - // same as scrollToShowRect - LLRect rect; - cntrl->localRectToOtherView(cntrl->getLocalRect(), &rect, this); - - // Translate to parent coordinatess to check if we are in visible rectangle - rect.translate(getRect().mLeft, getRect().mBottom); - - if (!getRect().contains(rect)) - { - // for accordition's scroll, height is in pixels - // Back to local coords and calculate position for scroller - S32 bottom = mScrollbar->getDocPos() - rect.mBottom + getRect().mBottom; - S32 top = mScrollbar->getDocPos() - rect.mTop + getRect().mTop; - - S32 scroll_pos = llclamp(mScrollbar->getDocPos(), - bottom, // min vertical scroll - top); // max vertical scroll - - mScrollbar->setDocPos(scroll_pos); - } - } - - LLUICtrl::onChildGotFocus(cntrl); -} - void LLAccordionCtrl::onOpen (const LLSD& key) { for(size_t i=0;igetVisible()) - { - LLRect rect; - cntrl->localRectToOtherView(cntrl->getLocalRect(), &rect, this); - - // Translate to parent coordinatess to check if we are in visible rectangle - rect.translate(getRect().mLeft, getRect().mBottom); - - if (!getRect().contains(rect)) - { - // for accordition's scroll, height is in pixels - // Back to local coords and calculate position for scroller - S32 bottom = mScrollbar->getDocPos() - rect.mBottom + getRect().mBottom; - S32 top = mScrollbar->getDocPos() - rect.mTop + getRect().mTop; - - S32 scroll_pos = llclamp(mScrollbar->getDocPos(), - bottom, // min vertical scroll - top); // max vertical scroll - - mScrollbar->setDocPos(scroll_pos); - } - } - - LLUICtrl::onChildGotFocus(cntrl); -} - BOOL LLAccordionCtrlTab::handleMouseDown(S32 x, S32 y, MASK mask) { if(mCollapsible && mHeaderVisible && mCanOpenClose) diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index 53546ad5a1..0263bce4be 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -159,7 +159,6 @@ public: * Raises notifyParent event with "child_visibility_change" = new_visibility */ void onVisibilityChange(BOOL new_visibility); - virtual void onChildGotFocus(const LLUICtrl * cntrl); // Changes expand/collapse state and triggers expand/collapse callbacks virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index ce9449f587..f324cfe653 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -709,7 +709,6 @@ void LLUICtrl::setFocus(BOOL b) if (!hasFocus()) { gFocusMgr.setKeyboardFocus( this ); - onChildGotFocus(this); } } else diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 63439fbf34..f94304a734 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -690,16 +690,6 @@ void LLView::onVisibilityChange ( BOOL new_visibility ) } } -// virtual -void LLView::onChildGotFocus(const LLUICtrl * cntrl) -{ - LLView* parent_view = getParent(); - if (parent_view) - { - parent_view->onChildGotFocus(cntrl); - } -} - // virtual void LLView::translate(S32 x, S32 y) { diff --git a/indra/llui/llview.h b/indra/llui/llview.h index bee9dd8c60..cd7b2b508c 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -307,7 +307,6 @@ public: virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); virtual void onVisibilityChange ( BOOL new_visibility ); - virtual void onChildGotFocus(const LLUICtrl * cntrl); void pushVisible(BOOL visible) { mLastVisible = mVisible; setVisible(visible); } void popVisible() { setVisible(mLastVisible); }