diff options
author | richard <none@none> | 2009-12-08 11:53:00 -0800 |
---|---|---|
committer | richard <none@none> | 2009-12-08 11:53:00 -0800 |
commit | a4f53bf15364cc7d16b71f195437f33fb057c4e5 (patch) | |
tree | 0cbd4bd7e30de1425bcc8c0c463edc955046cf5a /indra/llui/llscrollcontainer.cpp | |
parent | 25a773d79cc8b2e00f6769abe0717ac9b2325cd4 (diff) | |
parent | fa4d3e186741e89be62cf41da27c97820aa74982 (diff) |
merge
Diffstat (limited to 'indra/llui/llscrollcontainer.cpp')
-rw-r--r-- | indra/llui/llscrollcontainer.cpp | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index f6caed4617..a5e47e8547 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -235,18 +235,37 @@ BOOL LLScrollContainer::handleKeyHere(KEY key, MASK mask) BOOL LLScrollContainer::handleScrollWheel( S32 x, S32 y, S32 clicks ) { - if(LLUICtrl::handleScrollWheel(x,y,clicks)) + // Give event to my child views - they may have scroll bars + // (Bad UI design, but technically possible.) + if (LLUICtrl::handleScrollWheel(x,y,clicks)) return TRUE; - for( S32 i = 0; i < SCROLLBAR_COUNT; i++ ) - { - // Note: tries vertical and then horizontal + // When the vertical scrollbar is visible, scroll wheel + // only affects vertical scrolling. It's confusing to have + // scroll wheel perform both vertical and horizontal in a + // single container. + LLScrollbar* vertical = mScrollbar[VERTICAL]; + if (vertical->getVisible() + && vertical->getEnabled()) + { // Pretend the mouse is over the scrollbar - if( mScrollbar[i]->handleScrollWheel( 0, 0, clicks ) ) + if (vertical->handleScrollWheel( 0, 0, clicks ) ) { updateScroll(); - return TRUE; } + // Always eat the event + return TRUE; + } + + LLScrollbar* horizontal = mScrollbar[HORIZONTAL]; + // Test enablement and visibility for consistency with + // LLView::childrenHandleScrollWheel(). + if (horizontal->getVisible() + && horizontal->getEnabled() + && horizontal->handleScrollWheel( 0, 0, clicks ) ) + { + updateScroll(); + return TRUE; } return FALSE; } |