From d5a3eb04ef7d7e03da4af73b347ec59519899495 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 11 May 2020 20:46:56 +0200 Subject: [PATCH] BCardLayout: make the first item visible. Change-Id: I7b836a22bc5c281bec9b44859c42fec56af45574 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2683 Reviewed-by: Andrew Lindesay --- src/kits/interface/CardLayout.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/kits/interface/CardLayout.cpp b/src/kits/interface/CardLayout.cpp index cd8e2462c5..eccaf36fc5 100644 --- a/src/kits/interface/CardLayout.cpp +++ b/src/kits/interface/CardLayout.cpp @@ -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; }