Search Unity

Feedback Understanding Label spacing

Discussion in 'UI Toolkit' started by Catsoft-Studios, Feb 28, 2022.

  1. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    703
    I've been working with UI Toolkit for quite a bit and I must say I'm pretty satisfied with it! However, there's a couple of things that bug me a bit and it's the lack of consistency of the "growth" rate of an in-line Label and the control next to it.

    If someone at Unity could shed some light into this would be greatly appreciated!

    Let me put some examples of what I'm referring to.

    The Samples window that UIToolkit comes with have a fixed Label width of 117px + 3px of padding. The control on the right is what grows/shrinks:

    Large GIF (708x302).gif

    However, when creating a UIToolkit custom editor that uses PropertyFields, the behavior of the Label is that it grows with the control more or less at the same ratio, keeping the proportion (just like IMGUI controls):

    Large GIF (590x272).gif

    However! When using a TextArea, the behavior of this control is back to the first example, where the Label occupies a fixed value of 120 pixels and the rest is filled by the control:

    Large GIF (590x324).gif

    Could you tell us what's the real expected behavior? Is this something that's still under WIP or did you settle in a specific value? It grinds my OCD gears seeing all controls misaligned :p

    EDIT: Just to summarize, when creating a control using TextField, the label width is different than when using PropertyField, and binding it with a string SerializedProperty.
     
    Last edited: Feb 28, 2022
  2. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    703
    I've reported it as a bug (case 1407494), since looks like it should definitely not behave like that.

    Error.gif
     
    HugoBD-Unity likes this.