internal static void HandlePrefixLabelInternal(Rect totalPosition, Rect labelPosition, GUIContent label, int id, GUIStyle style) { if (id == 0 && label != null) { EditorGUI.s_PrefixLabel.text = label.text; EditorGUI.s_PrefixLabel.image = label.image; EditorGUI.s_PrefixLabel.tooltip = label.tooltip; EditorGUI.s_PrefixTotalRect = totalPosition; EditorGUI.s_PrefixRect = labelPosition; EditorGUI.s_PrefixStyle = style; } else { if (Highlighter.searchMode == HighlightSearchMode.PrefixLabel || Highlighter.searchMode == HighlightSearchMode.Auto) Highlighter.Handle(totalPosition, label.text); switch (Event.current.type) { case EventType.MouseDown: if (Event.current.button == 0 && labelPosition.Contains(Event.current.mousePosition)) { if (EditorGUIUtility.CanHaveKeyboardFocus(id)) GUIUtility.keyboardControl = id; EditorGUIUtility.editingTextField = false; HandleUtility.Repaint(); break; } break; case EventType.Repaint: ++labelPosition.width; style.DrawPrefixLabel(labelPosition, label, id); break; } EditorGUI.s_PrefixLabel.text = (string) null; } }
internal static void HandlePrefixLabelInternal(Rect totalPosition, Rect labelPosition, GUIContent label, int id, GUIStyle style) { if (id == 0 && label != null) { EditorGUI.s_PrefixLabel.text = label.text; EditorGUI.s_PrefixLabel.image = label.image; EditorGUI.s_PrefixLabel.tooltip = label.tooltip; EditorGUI.s_PrefixTotalRect = totalPosition; EditorGUI.s_PrefixRect = labelPosition; EditorGUI.s_PrefixStyle = style; return; } if (Highlighter.searchMode == HighlightSearchMode.PrefixLabel || Highlighter.searchMode == HighlightSearchMode.Auto) { Highlighter.Handle(totalPosition, label.text); } EventType type = Event.current.type; if (type != EventType.MouseDown) { if (type == EventType.Repaint) { labelPosition.width += 1f; style.DrawPrefixLabel(labelPosition, label, id); } } else { if (Event.current.button == 0 && labelPosition.Contains(Event.current.mousePosition)) { if (EditorGUIUtility.CanHaveKeyboardFocus(id)) { GUIUtility.keyboardControl = id; } EditorGUIUtility.editingTextField = false; HandleUtility.Repaint(); } } EditorGUI.s_PrefixLabel.text = null; }