BCardLayout: make the first item visible.

Change-Id: I7b836a22bc5c281bec9b44859c42fec56af45574
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2683
Reviewed-by: Andrew Lindesay <apl@lindesay.co.nz>
This commit is contained in:
Adrien Destugues 2020-05-11 20:46:56 +02:00 committed by waddlesplash
parent 451cf86feb
commit d5a3eb04ef

View File

@ -270,7 +270,10 @@ BCardLayout::Instantiate(BMessage* from)
bool
BCardLayout::ItemAdded(BLayoutItem* item, int32 atIndex)
{
item->SetVisible(false);
if (CountItems() <= 1)
SetVisibleItem(item);
else
item->SetVisible(false);
return true;
}