Vertically resize RangeSlider

hey, i have been trying to vertically resize RangeSlider, in this configuration where i use StaticText + loBox + RangeSlider + hiBox:

(
~makeRangeParamViews = {
	var rangeSliderView, layout;
	var rangeSlider, lowValueBox, highValueBox;

	rangeSliderView = View.new().layout_(VLayout.new());

	layout = HLayout.new(
		[StaticText.new().string_(\test), s: 1],
	);

	rangeSlider = RangeSlider.new()
	.orientation_(\horizontal);

	lowValueBox = NumberBox.new();
	highValueBox = NumberBox.new();

	layout.add(lowValueBox, 1);
	layout.add(highValueBox, 1);
	layout.add(rangeSlider, 4);

	rangeSliderView.layout.add(layout);

	rangeSliderView.front;

};

~makeRangeParamViews.();
)

when i add lowValueBox, highValueBox and then the RangeSlider the vertically resizing is working, if i first add lowValueBox, rangeSlider and then highValueBox its not vertically resizing:

(
~makeRangeParamViews = {
	var rangeSliderView, layout;
	var rangeSlider, lowValueBox, highValueBox;

	rangeSliderView = View.new().layout_(VLayout.new());

	layout = HLayout.new(
		[StaticText.new().string_(\test), s: 1],
	);

	rangeSlider = RangeSlider.new()
	.orientation_(\horizontal);

	lowValueBox = NumberBox.new();
	highValueBox = NumberBox.new();

	layout.add(lowValueBox, 1);
	layout.add(rangeSlider, 4);
	layout.add(highValueBox, 1);

	rangeSliderView.layout.add(layout);

	rangeSliderView.front;

};

~makeRangeParamViews.();
)

why is that? thanks

One thing that’s not clear from the original problem description is that you’re talking about the range slider’s vertical resize behavior. When I tried your examples, it does resize horizontally, but it resizes vertically only if it’s at the end.

(I assume that’s what you mean by “it’s not working”… in general, “it’s not working” leaves the reader to guess what you wanted. I tend to think there’s usually a more precise way to describe it.)

I don’t have a solution, but I had run into a similar problem before when I was trying to update EZSlider for layouts. But I think my opinion may be different from yours – I thought it was weird to have a label and number box with height = 20 or 25, and a slider with height = 100 or 200, and I wanted to prevent vertical resizing while allowing horizontal resizing. Now I see it’s likely to be possible by adding a dummy view at the end.

But it sounds like you want a very tall horizontal slider, with other views that are not as tall.

It’s a problem in the layout system that some views (NumberBox) prefer not to expand vertically, and there is no way to force them to expand vertically. "Expand to fit" size setting for views in layouts · Issue #3695 · supercollider/supercollider · GitHub (although, in that issue, case 1 has been resolved).

hjh

thanks, totally forgot about horizontal resize, so i have updated the initial post.

Beside a collection of Rangesliders + two Numberboxes in one layout i have a collection of Sliders + Numberbox in another layout and because of the first layout having a Numberbox at the end and the other not, the vertical resize behaviour is different.

If there is no solution to vertically resize the RangeSliders in this configuration, i will probably just add a dummy View to the slider layout, so at least their behaviour is the same.

But i will check out the Github link, thanks for that.