UIToolkit how to have a ListView with variable height

How I am suppose to replicate the standard list implementation of the PropertyDrawer of a list element ?

  • The ListView element cannot use variable height which is a requirement for what I am doing.
  • The ScrollView is bare bone, it does not look at all like the standard list implementation.

I have looked into what is being used by the Editor with the UI Toolkit Debugger, but it seem to be custom made and it seem like it would take a considerable amount of time to replicate the whole behavior. I would have expected it to be as simple as using a ListView or ScrollView component.

Behavior:

  • I want the possibility to set what the header text is bind to.
  • I want the possibility to modify the header of the list by adding a behavior where double clicking make it possible to rename the element.
  • I want the possibility to add an icon in the header which represent the element in the list.
  • I want the possibility to have variable height.
  • I want the possibility to change the order of the element in the list.
  • I want the possibility to override the add behavior

Style:

  • I want to have a “Foldout” element with the same style as what is used everywhere in the editor.
  • I want the list style to be similar to what is being used everywhere.

At the moment, it seem like I would be able to make more of what I want with the standard IMGUI implementation.

So my option are:

  1. Use IMGUI.
  2. Replicate the whole behavior by attempting to copy what I see from the UI Toolkit Debugger.
  3. Use a ScrollView with minimum styling and missing feature.
  4. Use a ListView with a “PopupWindow” to edit the content of each element

None of them are acceptable:

  1. I want to use UI Toolkit because it is supposedly the new way of doing Editor stuff.
  2. It would take too much time and I am not even sure if I would be able to make it.
  3. I want to have the same style of a standard element in the UI, with some adjustment.
  4. It adds additional manipulation and remove the possibility to see the content of multiple element at the same time.

Is there anything I am missing ?

So, I decided to make the whole thing in IMGUI and it took me pretty much 1 hour to do while I have been trying to do the same thing in UI Toolkit for a while.

There is something that does not add up. If UIToolkit is the future, why is it either really hard or impossible to make things in it ?

(I was able to make it that fast partly because of AI and because I have already experience doing it, but still.)

Have you set virtualizationMethod to CollectionVirtualizationMethod.DynamicHeight?
Because that should give you variable-height support at the cost of some performance.

1 Like

No I havent.

I will look into it next time I attempt to make something out of it.