HorizontalSplitPanel

I can’t figure out how to get a HorizontalSplitPanel to take up most of the screen height in the below setup. The panel height is smaller than its children so I’ll get a scroll bar at the right for some reason. Any suggestions on what to do to maximize the panel height?

VerticalLayout (width: 100%, height: 100%)
Label (width: 100%, height: 2%)
HorizontalSplitPanel (width: 100%, height: 98%)
CustomComponent (width: 100%, height: 100%, expandRatio: 1.0f)
CustomComponent (width: 100%, height: 100%, expandRatio: 1.0f)

Hey, are the CustomComponents inside the panel as first and second component?

If you have setup where you have inside full size VerticalLayout a Label and HorizontalSplitPanel you should set the expand ratio of the split to 1 and set split’s size to full. Don’t set height for the label, it’s unnecessary.

VerticalLayout.setSizeFull();

VerticalLayout.addComponent(Label)
VerticalLayout.addComponent(HorizontalSplitPanel)

HorizontalSplitPanel.setSizeFull();

VerticalLayout.setExpandRatio(HorizontalSplitPanel, 1)

HorizontalSplitPanel.setFirstComponent(CustomComponent)
HorizontalSplitPanel.setSecondComponent(CustomComponent)

And if you want custom components to take entire space inside the split, call setSizeFull for them. If size of your custom component is meant to be larger than there’s space in split panel, use Panel as composition root to allow scrolling inside the custom component.

Hope this helps!

Thanks for your input but can’t get it to work as I expect. I have a tree as the leftmost component and the horizontal split panel (HSP) grows if I expand the tree. My rightmost component happens to be larger than the leftmost component though so it is chopped off. The HSP seems to adapt its height to the leftmost component only. Comments?
12743.png