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
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user