From 992a8afd5d1b14902b376fdf64c7c415844647dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 26 Jun 2008 22:40:00 +0000 Subject: [PATCH] Resolved small TODO about detaching the scrollbar while doing bigger changes to the list in order to speed those up. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26142 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../mediaplayer/playlist/PlaylistListView.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/apps/mediaplayer/playlist/PlaylistListView.cpp b/src/apps/mediaplayer/playlist/PlaylistListView.cpp index 621cf1dfae..3e02d81889 100644 --- a/src/apps/mediaplayer/playlist/PlaylistListView.cpp +++ b/src/apps/mediaplayer/playlist/PlaylistListView.cpp @@ -384,10 +384,15 @@ PlaylistListView::_FullSync() if (!fPlaylist->Lock()) return; - // TODO: detach scrollbar, and this will be quick... -// BScrollBar* scrollBar = ScrollBar(B_VERTICAL); -// SetScrollBar(); -// + // detaching the scrollbar temporarily will + // make this much quicker + BScrollBar* scrollBar = ScrollBar(B_VERTICAL); + if (scrollBar) { + if (Window()) + Window()->UpdateIfNeeded(); + scrollBar->SetTarget((BView*)NULL); + } + MakeEmpty(); int32 count = fPlaylist->CountItems(); @@ -400,6 +405,12 @@ PlaylistListView::_FullSync() _SetCurrentPlaylistIndex(fPlaylist->CurrentRefIndex()); _SetPlaybackState(fController->PlaybackState()); + // reattach scrollbar and sync it by calling FrameResized() + if (scrollBar) { + scrollBar->SetTarget(this); + FrameResized(Bounds().Width(), Bounds().Height()); + } + fPlaylist->Unlock(); }