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