Bug fix for scrolling folder views.

An LLFolderView is added as child to LLScrollableContainerView,
but also adds the LLScrollableContainerView to it's mScrollContainer.
As a result, when scrolling inside a LLFolderView the event is passed to
the mScrollContainer, which then passes it first on to it's children
(see the "Bad UI design" remark in the code), causing an infinite loop.
This patch breaks that loop for those objects that have a
mScrollContainer: LLFolderView and LLContainerView.
This commit is contained in:
Aleric Inglewood
2013-02-11 03:36:46 +01:00
parent 2a177c6614
commit c18b156d8b
6 changed files with 20 additions and 4 deletions

View File

@@ -77,7 +77,8 @@ LLScrollableContainerView::LLScrollableContainerView( const std::string& name,
mReserveScrollCorner( FALSE ),
mMinAutoScrollRate( MIN_AUTO_SCROLL_RATE ),
mMaxAutoScrollRate( MAX_AUTO_SCROLL_RATE ),
mScrolledView( scrolled_view )
mScrolledView( scrolled_view ),
mPassBackToChildren(true)
{
if( mScrolledView )
{
@@ -218,7 +219,7 @@ BOOL LLScrollableContainerView::handleScrollWheel( S32 x, S32 y, S32 clicks )
{
// Give event to my child views - they may have scroll bars
// (Bad UI design, but technically possible.)
if (LLUICtrl::handleScrollWheel(x,y,clicks))
if (mPassBackToChildren && LLUICtrl::handleScrollWheel(x,y,clicks))
return TRUE;
// When the vertical scrollbar is visible, scroll wheel