[haiku-commits] haiku: hrev54194 - src/kits/interface

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 12 May 2020 22:06:23 -0400 (EDT)

hrev54194 adds 1 changeset to branch 'master'
old head: 451cf86feb3c9346ce4c0b805d4148310fda17d4
new head: d5a3eb04ef7d7e03da4af73b347ec59519899495
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=d5a3eb04ef7d+%5E451cf86feb3c

----------------------------------------------------------------------------

d5a3eb04ef7d: BCardLayout: make the first item visible.
  
  Change-Id: I7b836a22bc5c281bec9b44859c42fec56af45574
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/2683
  Reviewed-by: Andrew Lindesay <apl@xxxxxxxxxxxxxx>

                             [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev54194
Commit:      d5a3eb04ef7d7e03da4af73b347ec59519899495
URL:         https://git.haiku-os.org/haiku/commit/?id=d5a3eb04ef7d
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Mon May 11 18:46:56 2020 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Wed May 13 02:05:46 2020 UTC

----------------------------------------------------------------------------

1 file changed, 4 insertions(+), 1 deletion(-)
src/kits/interface/CardLayout.cpp | 5 ++++-

----------------------------------------------------------------------------

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;
 }
 


Other related posts:

  • » [haiku-commits] haiku: hrev54194 - src/kits/interface - waddlesplash