AddTab(): Explicitly select the first-added tab. Fixes the problem that the page

wouldn't be made visible, when the tabs were added after the tab view had been
attached to the window.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30398 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2009-04-25 16:46:17 +00:00
parent 705a97b615
commit 6217e77c65
1 changed files with 5 additions and 1 deletions

View File

@ -1128,11 +1128,15 @@ BTabView::AddTab(BView *target, BTab *tab)
tab = new BTab(target);
else
tab->SetView(target);
if (fContainerView->GetLayout())
fContainerView->GetLayout()->AddView(CountTabs(), target);
fTabList->AddItem(tab);
// When we don't have a any tabs yet, select this one.
if (CountTabs() == 1)
Select(0);
}