Nested Scroll windows?

Started by LWM, April 25, 2021, 10:43:27 PM

Previous topic - Next topic

LWM

Hey, everyone!  UI question here:

I have a Listing_Standard with a ScrollView, and inside that scroll view I get a Rect and inside that Rect I do the ThingFilter UI.  The problem is that the ThingFilter's scroll bars do not appear!  Only the ScrollView scroll bars appear...

Does anyone know if this problem will go away if I rewrite everything without the Listing_Standard?

LWM

Answer: it works when it's not a ThingFiter UI (with scroll bars) inside a Listing_Standard.

I got around the problem by using something like this:

Widgets.ScrollView(...);//use height to make Rects
var l = new Listing_Standard();
l.Begin(innerRect);
...
height=l.CurHeight; //height is an object field
l.End();
var filterRect = new Rect(...);
ThingFilterUI.DoThingFilterConfigWidnow(...);
Widgets.EndScrollView();

It works for now, anyway :)  But listing standards seem hard to use if you want to do anything slightly complicated.  :P

LWM

For 1.3, Listing_Standard no longer has a scroll view, so this workaround is a general way to fix any mod that use Listing_Standard's BeginScrollView &c.