internal void OnGUI() { if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Escape) { Close(); m_SearchView?.Focus(); return; } var oldLabelWidth = EditorGUIUtility.labelWidth; EditorGUIUtility.labelWidth = 95; GUI.Box(new Rect(0, 0, position.width, position.height), GUIContent.none, Styles.panelBorder); HandleKeyboardNavigation(); GUILayout.Label("Create New Search Query", Styles.filterHeader); GUILayout.Label(GUIContent.none, Styles.separator); using (new EditorGUILayout.HorizontalScope()) { GUI.SetNextControlName("CreateSearchQueryTextField"); EditorGUI.BeginChangeCheck(); m_QueryFileName = EditorGUILayout.TextField("Asset file name", m_QueryFileName, GUILayout.ExpandWidth(true)); if (EditorGUI.EndChangeCheck()) { m_QueryFileName = SearchQuery.RemoveInvalidChars(m_QueryFileName); } if (m_NeedFocus) { m_NeedFocus = true; EditorGUI.FocusTextInControl("CreateSearchQueryTextField"); } EditorGUIUtility.labelWidth = oldLabelWidth; using (new EditorGUI.DisabledScope(string.IsNullOrEmpty(m_QueryFileName))) { if (GUILayout.Button("Create", GUILayout.ExpandWidth(false))) { TryCreateSearchQuery(); } } } }
private IEnumerator PrepareSearchTool(QuickSearch qsWindow) { qsWindow.m_SendAnalyticsEvent = true; Assert.IsNotNull(qsWindow); yield return(null); qsWindow.Focus(); yield return(null); yield return(SendKeyCharacterEvent(qsWindow, (char)0, KeyCode.Backspace, EventModifiers.FunctionKey)); qsWindow.Refresh(); while (AsyncSearchSession.SearchInProgress) { yield return(null); } yield return(null); Assert.IsEmpty(qsWindow.Context.searchText); }