public override Vector2 GetWindowSize() { Vector2 size = m_Searchable.GetWindowSize(true); size.x = Mathf.Max(size.x, m_ButtonRect.width); return(size); }
private void Init(Rect buttonRect, SearchablePopup content) { m_Content = content; content.SetEditorWindow(this); m_LastWantedSize = content.GetWindowSize(false); m_LastWantedSize.x = Mathf.Max(m_LastWantedSize.x, buttonRect.width); Vector2 screenPos = GUIUtility.GUIToScreenPoint(new Vector2(buttonRect.x, buttonRect.y)); m_ActivatorRect = buttonRect; m_ActivatorRect.x = screenPos.x; m_ActivatorRect.y = screenPos.y; ShowAsDropDown(m_ActivatorRect, m_LastWantedSize); if (Event.current != null) { // We're inside OnGUI stuff, Bail out immediately GUIUtility.ExitGUI(); } }