[Solved] [Lemur] Having trouble with slider size

So, I’m making a sort of settings page, with inputs in a TabbedPanel for categorization.

Currently, I only have one tab with one Slider setting for testing.
However, this slider takes up the full size of the tab its on, regardless of what preferredSize I throw at it (I tried setting it to the width of the container its in, height of 10, and its own z pref) to no avail.

I’d like the slider (any input in there really) to only be a few pixels tall, like 10 to start with an example, so that everything stacks up the same size. Currently, it seems like the container is dividing the size between the elements, giving the lonely slider the full height, while two elements have half the height.

So, how do I size the input to say 10px tall without having elements stretch to fill the container?

Or, even better, is there a way to have a container/it’s elements NOT grow to fill the container?

A picture is worth 10,000,000 words.

1 Like

Yes my bad, one second

That whole thing in the Display tab is the slider, even though I set preferred size to 5 on the y axis.

I’m guessing a bit as to your layout but probably you can fix this by setting the y axis fill mode for your spring grid layout. For property panels and the like, it’s very common to set FillMode.Last for both X and Y. Any extra space then goes to the last component.

…and then sometimes adding an empty panel as the last component helps.

In your case, you may want to worry about it more when you have more of your UI elements in place. Trying to solve layout problems when you will be adding more elements anyway can be wasted effort.

1 Like

I actually didn’t set a layout, so default SpringGridLayout. But that is very useful information!

I will definitely do that!

I get what your saying. I think that’s a habit I picked up in WebDev, build section at a time so incorrect code/styles don’t cause an exploded page.

I’ll try to make a proper layout for that container and report back what I end up with. Much appreciated!

So, providing a layout with the FillModes to ForcedEven on X and None on Y onto the tab container fixed it!

The fix was as easy as

//containers.put("displaySettings",new Container()); //comment out
containers.put("displaySettings",new Container(new SpringGridLayout(Axis.X, Axis.Y, FillMode.ForcedEven, FillMode.None))); //add

Much appreciated @pspeed!