ScreenSaver: ScrollToSelection off-by-one

For some reason calling PopulateScreenSaver() list in AllAttached()
scrolls the selection off-by-one, so, call PopulateScreenSaverList()
in AttachedToWindow() and then call ScrollToSelection() again in
AllAttached() which seems to fix the problem.
This commit is contained in:
John Scipione 2013-09-10 18:46:09 -04:00
parent 5041c8ae6e
commit fb90f7ffe4
1 changed files with 4 additions and 1 deletions

View File

@ -583,6 +583,8 @@ ModulesView::DetachedFromWindow()
void
ModulesView::AttachedToWindow()
{
PopulateScreenSaverList();
fScreenSaversListView->SetTarget(this);
fTestButton->SetTarget(this);
fAddButton->SetTarget(this);
@ -592,7 +594,8 @@ ModulesView::AttachedToWindow()
void
ModulesView::AllAttached()
{
PopulateScreenSaverList();
fScreenSaversListView->ScrollToSelection();
// This only works after the list view is attached
fScreenSaversListView->Invoke(new BMessage(kMsgSaverSelected));
}