Search Unity

Bug UIBuilder: Incorrect text wrapping icons

Discussion in 'UI Toolkit' started by hawaiian_lasagne, Jun 17, 2021.

  1. hawaiian_lasagne

    hawaiian_lasagne

    Joined:
    May 15, 2013
    Posts:
    124
    The icons for text wrapping in the uibuilder inspector are the wrong way round, please fix:

    upload_2021-6-17_12-38-37.png
     

    Attached Files:

  2. hawaiian_lasagne

    hawaiian_lasagne

    Joined:
    May 15, 2013
    Posts:
    124
    Just to clarify, the tooltip is correct, but I need to select 'nowrap' to make the text wrap. Its backwards
     
  3. hawaiian_lasagne

    hawaiian_lasagne

    Joined:
    May 15, 2013
    Posts:
    124
    OK no I am wrong. Icons are correct, but the default value for text wrapping is set to 'wrap' but it doesn't actually work. I had to select nowrap, and then reselect wrap for it to work. IDK what is going on here but it is buggy.
     
  4. griendeau_unity

    griendeau_unity

    Unity Technologies

    Joined:
    Aug 25, 2020
    Posts:
    248
    What version of the engine/package are you on?
    It seems to be working properly in the latest version, but we might need to open a backport case for this.
     
  5. hawaiian_lasagne

    hawaiian_lasagne

    Joined:
    May 15, 2013
    Posts:
    124
    I'm using: 2021.1.10f1

    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",

    Let me know if there's anything else you need
     
  6. griendeau_unity

    griendeau_unity

    Unity Technologies

    Joined:
    Aug 25, 2020
    Posts:
    248
    I tried on 2021.1 and still see it behaving correctly. I tried on a Label and a Button text. The default wrap mode is
    no-wrap
    . That button is highlighted in the builder, and if I click on
    wrap
    icon, it does wrap.
    Are you using a different control?
     
  7. hawaiian_lasagne

    hawaiian_lasagne

    Joined:
    May 15, 2013
    Posts:
    124
    Using the standard label. OK here's some more details:

    I've created a uss selector targeting the node by id, and the default value for the selector is set to wrap.

    The default value for the uxml control though is set to no-wrap.

    So after creating the uss-selector, it looks like the text should wrap because that is what's highlighted. And I have to select/deselect for it to actually work. Unsetting the selector value then reverts back to no-wrap behaviour, but with 'wrap' still set in the selector.

    Does that make sense?

    I can upload a project it it would help.
     
  8. martinpa_unity

    martinpa_unity

    Unity Technologies

    Joined:
    Oct 18, 2017
    Posts:
    480
    Hi @hawaiian_lasagne, when inspecting a uss selector, what you see in the inspector is all the available style properties that are supported in the UI Builder. By default, the selector doesn't contain any of the style properties. When it is set, there will be a white bar on the left. When the white bar is not there, it means that the property doesn't exist on the selector rather than "here is the value we will use".

    When selecting an element in the hierarchy, the inspector shows a mix of inline style properties and computed style properties. Since both inspectors look very similar, it ends up being confusing. We are aware of this workflow quirk.

    To set the style property of a uss selector without needing to select a different value and re-select the correct one, you can use the contextual menu on the label and choose `Set`.

    Hope this helps!
     
  9. hawaiian_lasagne

    hawaiian_lasagne

    Joined:
    May 15, 2013
    Posts:
    124
    Cool thanks for clarifying! It was the white bar I wasn’t paying attention to.

    Now I know what’s going on I shouldn’t run into this again.

    Cheers again!
     
    martinpa_unity likes this.