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

Feature Request We want more features for UIElements namespace !

Discussion in 'UI Toolkit' started by aybeone, Dec 17, 2018.

  1. aybeone

    aybeone

    Joined:
    May 24, 2015
    Posts:
    107
    While it's still quite convoluted to get something up with this new approach, the results are really gratifying !

    See the following example:

    I want to make the TextField read-only but there is no property in UXML to do so, instead I have to do the following:

    Code (CSharp):
    1. var textField = tree.Q<TextField>("base_directory_field");
    2. textField.SetEnabled(false);
    PS when disabling it, the picker of UIElements debugger simply don't see it, I believe it should (it's a debugger after all).

    Some of the things that could be improved:
    • expose an enabled property on UXML or a read-only property
    • add binding-path to more types such as Label
    • some types could have a fallback-value property that will be shown when it's not yet set, e.g. like in WPF
    • the ability to navigate in the UI with the keyboard with [Shift] Tab and so on
    Thanks !
     
    Last edited: Dec 17, 2018
  2. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    Hello! These are all great suggestions! We're actually already actively working on some of them (like a read-only field). For the rest, I added them to our internal tracking.

    Also, for:
    - the ability to navigate in the UI with the keyboard with [Shift] Tab and so on
    this is actually already possible. Tab should work between fields by default. You can further define the order via the tabIndex property.
     
  3. aybeone

    aybeone

    Joined:
    May 24, 2015
    Posts:
    107
  4. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    Thanks for the bug report!

    For keyboard navigation, do you mean navigate between different EditorWindows? Where does the tab-navigation stop working?
     
  5. aybeone

    aybeone

    Joined:
    May 24, 2015
    Posts:
    107
    I mean that buttons can never be navigated to with the keyboard.

    In the example window of the bug report, click one of the field to make it focused (this is also a bug related to focus, the newly opened window is focused but keyboard navigation is not readily available :)), then press Tab until you cycle through all the elements; you will see that buttons can never be navigated to with the keyboard :eek:.
     
  6. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    Ah, our buttons are not focusable and even if you make them they are only designed to respond to mouse events. I'll add this request to our tracking. Thanks for pointing it out.
     
    MechEthan likes this.
  7. aybeone

    aybeone

    Joined:
    May 24, 2015
    Posts:
    107
    Eager for the next beta release :D
     
  8. MechEthan

    MechEthan

    Joined:
    Mar 23, 2016
    Posts:
    166
    You probably already know & noted this, but just in case: Making buttons focusable is a big Accessibility issue.

    (I'm only saying this to help w/ prioritiziation -- to me, Accessibility considerations seem like a requirement for shipping a 1.0.)
     
    aybeone likes this.
  9. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    I agree!
     
    MechEthan likes this.