From 2cd7a7550991df90288aa4c7e2fbe2598cc3c296 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 27 Jan 2012 18:40:23 -0800 Subject: EXP-1747, EXP-1152 : Fixed visual glitches in computation of visible width in inventory. --- indra/llui/llscrollcontainer.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'indra/llui/llscrollcontainer.cpp') diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index ad4cc20d9a..20bed050ad 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -378,23 +378,21 @@ void LLScrollContainer::calcVisibleSize( S32 *visible_width, S32 *visible_height if (!mHideScrollbar) { - if( *visible_height < doc_height ) + // Note: 1 pixel change can happen on final animation and should not trigger + // the display of sliders. + if ((doc_height - *visible_height) > 1) { *show_v_scrollbar = TRUE; *visible_width -= scrollbar_size; } - - if( *visible_width < doc_width ) + if ((doc_width - *visible_width) > 1) { *show_h_scrollbar = TRUE; *visible_height -= scrollbar_size; - - // Must retest now that visible_height has changed - if( !*show_v_scrollbar && (*visible_height < doc_height) ) - { - *show_v_scrollbar = TRUE; - *visible_width -= scrollbar_size; - } + // Note: Do *not* recompute *show_v_scrollbar here because with + // the (- scrollbar_size) we just did we will always add a vertical scrollbar + // even if the height of the items is actually less than the visible size. + // Fear not though: there's enough calcVisibleSize() calls to add a vertical slider later. } } } -- cgit v1.2.3 From 34c599858bd64b7fbda767ff9c9f7d8bcd2c2c25 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Fri, 16 Mar 2012 01:08:20 +0200 Subject: CHUI-53 FIXED vertical scroll bar in inventory floater to appear when horizontal scroll bar hides last item in folder view. Added a scroll container which provides the information about the height of currently displayed folder view contents. It is used for updating vertical scroll bar visibility in inventory panel. --- indra/llui/llscrollcontainer.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'indra/llui/llscrollcontainer.cpp') diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index 20bed050ad..9b7e30bb04 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -389,10 +389,17 @@ void LLScrollContainer::calcVisibleSize( S32 *visible_width, S32 *visible_height { *show_h_scrollbar = TRUE; *visible_height -= scrollbar_size; - // Note: Do *not* recompute *show_v_scrollbar here because with - // the (- scrollbar_size) we just did we will always add a vertical scrollbar - // even if the height of the items is actually less than the visible size. - // Fear not though: there's enough calcVisibleSize() calls to add a vertical slider later. + + // The view inside the scroll container should not be extended + // to container's full height to ensure the correct computation + // of *show_v_scrollbar after subtracting horizontal scrollbar_size. + + // Must retest now that visible_height has changed + if( !*show_v_scrollbar && ((doc_height - *visible_height) > 1) ) + { + *show_v_scrollbar = TRUE; + *visible_width -= scrollbar_size; + } } } } -- cgit v1.2.3