Skip to content

Commit de1aa47

Browse files
committed
Formatting
1 parent 09d6044 commit de1aa47

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,18 @@ IEnumerator WaitForActionMapRename(int index, bool isActive, double timeoutSecs
5757
return false;
5858
}, $"WaitForActionMapRename {index} {isActive}", timeoutSecs);
5959
}
60-
60+
6161
IEnumerator WaitForActionRename(int index, bool isActive, double timeoutSecs = 5.0)
6262
{
6363
return WaitUntil(() =>
64+
{
65+
var actionItems = m_Window.rootVisualElement.Q("actions-container").Query<InputActionsTreeViewItem>().ToList();
66+
if (actionItems.Count > index && actionItems[index].IsFocused == isActive)
6467
{
65-
var actionItems = m_Window.rootVisualElement.Q("actions-container").Query<InputActionsTreeViewItem>().ToList();
66-
if (actionItems.Count > index && actionItems[index].IsFocused == isActive)
67-
{
68-
return true;
69-
}
70-
return false;
71-
}, $"WaitForActionRename {index} {isActive}", timeoutSecs);
68+
return true;
69+
}
70+
return false;
71+
}, $"WaitForActionRename {index} {isActive}", timeoutSecs);
7272
}
7373

7474
#endregion
@@ -189,7 +189,7 @@ public IEnumerator CanDeleteActionMap()
189189
Assert.That(m_Window.currentAssetInEditor.actionMaps[0].name, Is.EqualTo("First Name"));
190190
Assert.That(m_Window.currentAssetInEditor.actionMaps[1].name, Is.EqualTo("Third Name"));
191191
}
192-
192+
193193
[UnityTest]
194194
public IEnumerator CanRenameAction()
195195
{
@@ -215,7 +215,7 @@ public IEnumerator CanRenameAction()
215215
{
216216
SimulateClickOn(actionItem[1]);
217217
}
218-
218+
219219
// Get the element that has focus before rename
220220
var focusedElement = m_Window.rootVisualElement.Q<TreeView>("actions-tree-view").focusController.focusedElement;
221221

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public override void RedrawUI(ViewState viewState)
204204
{
205205
// Store the current focus before Clear/Rebuild
206206
Focusable focusedElement = m_ActionsTreeView.focusController.focusedElement;
207-
207+
208208
m_ActionsTreeView.Clear();
209209
m_ActionsTreeView.SetRootItems(viewState.treeViewData);
210210
m_ActionsTreeView.Rebuild();
@@ -218,10 +218,10 @@ public override void RedrawUI(ViewState viewState)
218218

219219
// Don't want to show action properties if there's no actions.
220220
m_PropertiesScrollview.visible = m_ActionsTreeView.GetTreeCount() > 0;
221-
221+
222222
// Rebuild causes the ActionsTreeView to lose focus; restore if there was focus before
223223
if (focusedElement != null)
224-
{
224+
{
225225
focusedElement.Focus();
226226
}
227227
}

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/InputActionsTreeViewItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal class InputActionsTreeViewItem : VisualElement
1616

1717
private const string kRenameTextField = "rename-text-field";
1818
public event EventCallback<string> EditTextFinished;
19-
19+
2020
// for testing purposes to know if the item is focused to accept input
2121
internal bool IsFocused { get; private set; } = false;
2222

0 commit comments

Comments
 (0)