Search Unity

How to change the size of Controls (TextField's input box in particular)

Discussion in 'UIElements' started by JennyHide, Jun 8, 2019.

  1. JennyHide

    JennyHide

    Joined:
    Sep 30, 2014
    Posts:
    33
    Hello,

    I'm testing the GraphView API and added a TextField to my test node. The label takes up loads of space while the input box is squashed onto the end:

    upload_2019-6-8_19-3-18.png

    How can I change the default width of both boxes?

    Looking at the code (https://github.com/Unity-Technologi...0796/Modules/UIElements/Controls/TextField.cs) I assumed it'd be with USS, adding a new class to the "visualInput" variable, but visualInput is not accessible. Is there another way?

    Also, is there a way to set the maximum size of the input box - the default behaviour is for the box to get bigger the more text I add into it.

    Thanks,
    Jenny
     
  2. JennyHide

    JennyHide

    Joined:
    Sep 30, 2014
    Posts:
    33
    I worked it out - I just needed to override the appropriate USS classes in my own USS script!