-
Notifications
You must be signed in to change notification settings - Fork 330
Add UI Toolkit matching control bindings UI #1835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Tightened up layout of control scheme text and the matching paths tree view labels Removed the 'show matching paths' checkbox Attempted to save and restore expansion of the 'Derived Paths' but waiting on feedback on how to respond to expand/collapse from UI TK team.
Moved some more of the style to uss file Changed a label to a HelpBox to match UGUI version Switched to toggle/checkbox for the main "Show matching bindings" part as we can't detect expand/collapse in tree Removed an unused callback Renamed some functions to be clearer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to see this working!
I just have one major point- I think it could be worth outsourcing the biggest part of the DrawMatchingControlPath and connected methods to an external script (or other related existing classes). Like that we could keep the PropertiesView clean and "logic free".
I also added one minor comment on a potential unused method to remove.
...ages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/BindingPropertiesView.cs
Outdated
Show resolved
Hide resolved
Yes I agree I can take a look at spitting those out |
ritamerkl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now
|
Is the style used wrong? Why is the derived binding text selectable? It wasn't like that in the IMGUI version and I don't see why that should be changed |
Unity_2024-02-09_13-47-02.mp4Since this is a toggle now I think its state should be saved, seems annoying to have to re-enable it between window restarts |
Pauliusd01
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just minor notes from me. Functionality seems the same and works without issues
So like IMGUI version
I've fixed that - it was just the default for the UI TK tree view. |
I'd like to do that but I don't have a quick fix for that so might land the update so far and look at that later. |
Does it have to be a toggle then? If a foldout would solve this issue I'd prefer that, and later on we can switch it to a toggle once state saving is there |
State is now maintained over open/close to match IMGUI. |
ekcoh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, is all logic in MatchingControlPaths new? If it is then its fine as-is, otherwise it might be worthwhile avoiding duplicating logic with existing feature implementation for IMGUI? It seems like MatchingControlPaths is not tied to UI framework and would be possible to cover with unit tests?
The MatchingControlPaths isn't all new code - its adapted from the IMGUI version. It drops some of the code for retaining the expand/collapse state of individual parts of the hierarchy as that had a static dictionary that seemed lower priority for the memory overheads. To use in IMGUI directly we would have to add back in the static dictionary and store extra state in the returned data. I decided to duplicate as the IMGUI version would be deprecated in future. Tests should be added but I felt given time constraints that part could be added later. |
…d UITK editors And fixed the foldout callback to only trigger on the foldout and not its children
Pauliusd01
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, checked that the matching bindings are correct for different bindings in both ProjectWideActions and custom action assets.
I see, great to avoid duplicating too much. OK to postpone the test part temporarily but in that case please file a ticket on the remaining part from your perspective. |
Description
Implemented UI TK version of the matching control bindings recently added to the IMGUI editor
#1672
Example of it working in the project wide input actions. This is the same UX used in the individual assets.

Changes made
The code to populate the UX is the same as the IMGUI code - but split out to generate a tree before then generating the UI specific tree.
Also fixed up some styling on the control scheme info which is in the binding UI to be more consistent with the IMGUI version. Bolded and fixed margins.
Notes
Note this version doesn't store the full tree state - just the expanded/not level.
This means I didn't need to add the static dictionary which was present in the IMGUI version.
I didn't feel this was critical and reduced static state.
I also had to make the top level expansion based on e checkbox rather than a 'fold out' / top of tree as the UI TK treeView doesn't have API to react to the expand/collapse state.
^ This comment is old - I've added a Foldout to replace the Toggle now
Checklist
Before review:
During merge:
NEW: ___.FIX: ___.DOCS: ___.CHANGE: ___.RELEASE: 1.1.0-preview.3.