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:
parent
5041c8ae6e
commit
fb90f7ffe4
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue