Search Unity

Feature Request Inspector LabelWidth should have a maximum

Discussion in 'Editor & General Support' started by Soraphis, Apr 21, 2023.

  1. Soraphis

    Soraphis

    Joined:
    Oct 25, 2013
    Posts:
    17
    As of Unity 2022.2.16 (and i guess since 5.3 or even before) the inspector's labelwidth grows with the size of the inspector.

    It would be nice, if it would grow only to a maximum e.g. 250 or 300 (px).

    Sometimes my custom drawers can get kinda crammed - and i can live with that - so I usually will make the inspector larger if i need to, but since the labelWidth grows with it it's so much wasted space without any benefit.

    Also i guess the fix would be like changing 1 line to include a call to "min(..."

    Sure with UIElements I could overwrite the editor styles probably to give it a maximum value, but since a lot of already existing drawers (TriInspector, NaughtyAttributes, My own custom stuff) are still in IMGUI....

    edit:

    https://github.com/Unity-Technologi...ono/UIElements/Controls/PropertyField.cs#L411

    https://github.com/Unity-Technologi...lob/master/Editor/Mono/EditorGUI.cs#L113-L116

    there it is, it has a minimumWidth, but no maximum and grows with 45% of the totalWidth
     
    Last edited: Apr 21, 2023