Trying to recreate the dropdowns containing other VisualEements, like the ones in the GameView

Hi,

My goal is to recreate the kind of dropdowns that exist in the GameView, like this one:

As you can see, this dropdown doesn’t just contains options, but also toggles and buttons, which I assume are UIElements. However, using the UI Toolkit Debugger on the GameView yields no results, it just displays a single element for the entire window. I assume (correct me if I’m wrong) this is because the GameView is still written in the old IMGUI framework, and so doesn’t offer the same options as UIElements.

I would like to know if it was possible to easily recreate this style of dropdown with VisualElements, ideally with a suited component or method, or if there is a way to override the dropdown list to change its apparence and content. So far, I have tried a regular ToolbarMenu component parented to a Toolbar VisualElement, but the list of options is the default one.

Thank you for your time.

After searching for a bit, I found the ‘variant’ property in the Scripting API documentation: Unity - Scripting API: Variant

However, I have found this thread a few years back: ToolbarMenu variants look identical?

It seems the Popup style was not implemented back then, and after a few tests, it seems it’s still not the case yet? Has anyone found a workaround for this? Is there any ETA on this feature?

You’d want to make a pop-up window: Unity - Manual: Create a pop-up window

1 Like

Great, this is what I was looking for. Thank you for your help!

1 Like