Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#15854 closed bug (fixed)

BCardLayout: all items are visible at start

Reported by: X512 Owned by: nobody
Priority: normal Milestone: R1/beta2
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by X512)

This is hrev54024.

When using following code to build layout, all card items are visible simultaneously at start:

BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
    .AddCards()
        .GetLayout(&fCardLayout)
        .AddGroup(B_VERTICAL, 0)
            .AddGroup(B_HORIZONTAL, 0)
                .Add(fWizardView, 0)
                .Add(fIntroContainerView)
                .End()
            .End()
        .AddGroup(B_VERTICAL, 0)
            .Add(fHeaderContainerView)
            .Add(new BSeparatorView(B_HORIZONTAL))
            .AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING)
                .SetInsets(B_USE_DEFAULT_SPACING)
                .Add(fLicenseCaption1View, 0)
                .Add(new BScrollView("scrollview", fLicenseView, 0, true, true, B_PLAIN_BORDER))
                .Add(fLicenseCaption2View, 0)
                .End()
            .End()
        .End()
    .End()

Following workaround fixes problem:

fCardLayout->SetVisibleItem(1);
fCardLayout->SetVisibleItem(0);

It seems that BCardLayout don’t handle non-BView items properly.

Change History (6)

comment:2 by X512, 5 years ago

Description: modified (diff)

comment:3 by nielx, 5 years ago

Interestingly enough I just wrote documentation about this. It seems like the class is designed to show no item, unless explicitly called with SetVisibleItem. It seems to me that the layout should hide items while they are added.

comment:4 by pulkomandy, 5 years ago

Does https://review.haiku-os.org/c/haiku/+/2683 help with that? It makes the first item visible by default.

comment:5 by waddlesplash, 5 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev54194.

comment:6 by nielx, 5 years ago

Milestone: UnscheduledR1/beta2

Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone

Note: See TracTickets for help on using tickets.