Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Can a foldout header contain more than just text?

Discussion in 'UI Toolkit' started by tmhbrts, Nov 13, 2019.

  1. tmhbrts

    tmhbrts

    Joined:
    Dec 24, 2013
    Posts:
    13
    Hi all,

    I was wondering if it is possible to use UIElements to make the header of a foldout element consist of more than just text.
    An example of this can be seen in the inspector window where it also contains toggles and icons:


    Thanks in advance,
    Tim
     
  2. AlexandreT-unity

    AlexandreT-unity

    Unity Technologies

    Joined:
    Feb 1, 2018
    Posts:
    358
    Hi @tmhbrts, there's no direct way to do this at the moment. An option would be search the VisualElement hierarchy to get the label and inject it (or its parent) with whatever you need. The UIElements Debugger might be of some help for that. Beware that this approach may not be forward compatible.