-
Notifications
You must be signed in to change notification settings - Fork 332
Fix ISXB-1782: Invert processor (and other parameterless items) no lo… #2375
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -170,9 +170,19 @@ | |
|
|
||
| var foldout = container.Q<Foldout>("Foldout"); | ||
| foldout.text = parameterListView.name; | ||
| parameterListView.OnDrawVisualElements(foldout); | ||
|
|
||
| foldout.Add(new IMGUIContainer(parameterListView.OnGUI)); | ||
| if (parameterListView.hasUIToShow) | ||
| { | ||
| parameterListView.OnDrawVisualElements(foldout); | ||
| foldout.Add(new IMGUIContainer(parameterListView.OnGUI)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It is recommended to clear the content container before adding new elements, or to reuse an existing 🤖 Helpful? 👍/👎 |
||
| } | ||
| else | ||
| { | ||
|
Check warning on line 180 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/NameAndParametersListView.cs
|
||
| // ISXB-1782: No expandable foldout when processor/interaction has no properties (e.g. Invert) | ||
| foldout.value = false; | ||
| foldout.SetEnabled(false); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because the Move Up, Move Down, and Delete buttons are added as children to the foldout's header ( Since you are already hiding the expand arrow via the 🤖 Helpful? 👍/👎 |
||
| foldout.AddToClassList("name-and-parameters-list-foldout--no-content"); | ||
| } | ||
|
Check warning on line 185 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/NameAndParametersListView.cs
|
||
| } | ||
| } | ||
| } | ||
|
|
||
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.
When using
VisualElementrecycling (common in virtualized lists likeListView), state changes such asSetEnabledandAddToClassListmust be explicitly handled in both branches of the conditional logic. If a recycled element is reused for an item wherehasUIToShowis true after being used for one where it was false, it will remain disabled and keep the--no-contentclass.Consider resetting the state in the
ifblock:🤖 Helpful? 👍/👎