From d52ffca978487d12ef5c08accea5dd442f0b931f Mon Sep 17 00:00:00 2001 From: John Scipione Date: Sun, 14 Apr 2013 14:53:58 -0400 Subject: [PATCH] If above the scroll limit, scroll to limit. This case happens when you are scrolled to the end of the list and you do an action that causes the view to shrink but not enough for the scroll arrows to be detached such as remove a team or unexpand an application. Before it would keep you where you were showing an extra grey area, now it scrolls you back to the new scroll limit. --- src/apps/deskbar/InlineScrollView.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/apps/deskbar/InlineScrollView.cpp b/src/apps/deskbar/InlineScrollView.cpp index 5d38f40797..16225a6197 100644 --- a/src/apps/deskbar/InlineScrollView.cpp +++ b/src/apps/deskbar/InlineScrollView.cpp @@ -451,6 +451,17 @@ TInlineScrollView::AttachScrollers() fScrollLimit = fTarget->Bounds().Width() - (frame.Width() - 2 * kScrollerDimension); } + + if (fScrollValue > fScrollLimit) { + // If scroll value is above limit scroll back + float delta = fScrollLimit - fScrollValue; + if (fOrientation == B_VERTICAL) + fTarget->ScrollBy(0, delta); + else + fTarget->ScrollBy(delta, 0); + + fScrollValue = fScrollLimit; + } return; }