private float CalcPopupWidth(string[] options, GUIStyle style) { float width = 0; for (int i = 0; i < options.Length; ++i) { width = Mathf.Max(width, SharedStyles.MeasureWidth(style, options[i])); } return(width); }
public override void OnGUI() { if (m_title != null) { EditorGUILayout.BeginHorizontal(); { GUIStyle style = EditorStyles.miniLabel; if (m_titleWith == 0) { m_titleWith = SharedStyles.MeasureWidth(style, m_title); } GUILayout.Label(m_title, style, GUILayout.Width(m_titleWith)); DrawPopup(); } EditorGUILayout.EndHorizontal(); } else { DrawPopup(); } }
public float CalcHeight(string text, float width) { return(SharedStyles.MeasureHeight(m_style, text, width)); }
public Vector2 CalcSize(string text) { return(SharedStyles.MeasureText(m_style, text)); }
public ToolBarCheckbox(string title, ToggleButtonDelegate buttonDelegate) : base(title, buttonDelegate) { Width = SharedStyles.MeasureWidth(GUI.skin.toggle, title); }
public ToolBarToggle(string title, ToggleButtonDelegate buttonDelegate) : base(title, buttonDelegate) { Width = SharedStyles.MeasureWidth(SharedStyles.toolbarButton, title); }