hrev44353 adds 1 changeset to branch 'master' old head: af2f75a0167a11a9a9fa212a0a4e5d2671cfd8a1 new head: ed15f1b8fb8b635349829c655678177ad3032ccc ---------------------------------------------------------------------------- ed15f1b: Fix scrollbar handling when removing rows in BCLV. - If removing a row results in there no longer being any rows whatsoever visible, force a scroll back into the visible range. Fixes #8287. [ Rene Gollent <anevilyak@xxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev44353 Commit: ed15f1b8fb8b635349829c655678177ad3032ccc URL: http://cgit.haiku-os.org/haiku/commit/?id=ed15f1b Author: Rene Gollent <anevilyak@xxxxxxxxx> Date: Thu Jul 19 03:00:53 2012 UTC Ticket: https://dev.haiku-os.org/ticket/8287 ---------------------------------------------------------------------------- 1 file changed, 11 insertions(+), 1 deletion(-) src/kits/interface/ColumnListView.cpp | 12 +++++++++++- ---------------------------------------------------------------------------- diff --git a/src/kits/interface/ColumnListView.cpp b/src/kits/interface/ColumnListView.cpp index baa05a2..8123c69 100644 --- a/src/kits/interface/ColumnListView.cpp +++ b/src/kits/interface/ColumnListView.cpp @@ -4090,6 +4090,16 @@ OutlineView::RemoveRow(BRow* row) fItemsHeight -= subTreeHeight; FixScrollBar(false); + int32 indent = 0; + float top = 0.0; + if (FindRow(fVisibleRect.top, &indent, &top) == NULL && ScrollBar(B_VERTICAL) != NULL) { + // after removing this row, no rows are actually visible any more, + // force a scroll to make them visible again + if (fItemsHeight > fVisibleRect.Height()) + ScrollBy(0.0, fItemsHeight - fVisibleRect.Height() - Bounds().top); + else + ScrollBy(0.0, -Bounds().top); + } if (parentRow != NULL) { parentRow->fChildList->RemoveItem(row); if (parentRow->fChildList->CountItems() == 0) { @@ -4294,7 +4304,7 @@ OutlineView::FixScrollBar(bool scrollToFit) float maxScrollBarValue = fItemsHeight - fVisibleRect.Height(); vScrollBar->SetProportion(fVisibleRect.Height() / fItemsHeight); - // If the user is scrolled down too far when makes the range smaller, the list + // If the user is scrolled down too far when making the range smaller, the list // will jump suddenly, which is undesirable. In this case, don't fix the scroll // bar here. In ScrollTo, it checks to see if this has occured, and will // fix the scroll bars sneakily if the user has scrolled up far enough.