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
|
void
|
||||||
ModulesView::AttachedToWindow()
|
ModulesView::AttachedToWindow()
|
||||||
{
|
{
|
||||||
|
PopulateScreenSaverList();
|
||||||
|
|
||||||
fScreenSaversListView->SetTarget(this);
|
fScreenSaversListView->SetTarget(this);
|
||||||
fTestButton->SetTarget(this);
|
fTestButton->SetTarget(this);
|
||||||
fAddButton->SetTarget(this);
|
fAddButton->SetTarget(this);
|
||||||
@@ -592,7 +594,8 @@ ModulesView::AttachedToWindow()
|
|||||||
void
|
void
|
||||||
ModulesView::AllAttached()
|
ModulesView::AllAttached()
|
||||||
{
|
{
|
||||||
PopulateScreenSaverList();
|
fScreenSaversListView->ScrollToSelection();
|
||||||
|
// This only works after the list view is attached
|
||||||
fScreenSaversListView->Invoke(new BMessage(kMsgSaverSelected));
|
fScreenSaversListView->Invoke(new BMessage(kMsgSaverSelected));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user