Skip to content

Commit 379e961

Browse files
authored
Merge pull request #9976 from keveleigh/update-controller-mapping-list
Update controller mapping list header and alignment
2 parents 9b61acf + 4666096 commit 379e961

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

Assets/MRTK/Core/Inspectors/ControllerPopupWindow.cs

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -316,40 +316,13 @@ private void RenderMappingList(List<string> controllerList)
316316
return;
317317
}
318318

319-
GUIStyle headerStyle = new GUIStyle();
320-
headerStyle.richText = true;
321-
322-
if (currentControllerOption == null || currentControllerTexture == null)
319+
using (new EditorGUILayout.VerticalScope())
323320
{
324-
GUILayout.BeginVertical();
325-
using (new EditorGUILayout.VerticalScope())
326-
{
327-
GUILayout.FlexibleSpace();
328-
EditorGUILayout.LabelField("<b>Controllers affected by this mapping</b>", headerStyle);
329-
for (int i = 0; i < controllerList.Count; i++)
330-
{
331-
EditorGUILayout.LabelField(controllerList[i]);
332-
}
333-
}
334-
GUILayout.EndVertical();
335-
}
336-
else
337-
{
338-
float max_y = currentControllerOption.InputLabelPositions.Max(x => x.y);
339-
340-
var titleRectPosition = Vector2.up * (max_y + 4 * EditorGUIUtility.singleLineHeight);
341-
var titleRectSize = new Vector2(500, EditorGUIUtility.singleLineHeight);
342-
343-
var titleRect = new Rect(titleRectPosition, titleRectSize);
344-
EditorGUI.LabelField(titleRect, "<b>Controllers affected by this mapping</b>", headerStyle);
345-
321+
GUILayout.FlexibleSpace();
322+
EditorGUILayout.LabelField("Controllers affected by this mapping", EditorStyles.boldLabel);
346323
for (int i = 0; i < controllerList.Count; i++)
347324
{
348-
var rectPosition = Vector2.up * (max_y + (i + 5) * EditorGUIUtility.singleLineHeight);
349-
var rectSize = new Vector2(1000, EditorGUIUtility.singleLineHeight);
350-
351-
var labelRect = new Rect(rectPosition, rectSize);
352-
EditorGUI.LabelField(labelRect, controllerList[i]);
325+
EditorGUILayout.LabelField(controllerList[i]);
353326
}
354327
}
355328
}

0 commit comments

Comments
 (0)