Пример #1
0
        internal void OnGUI()
        {
            if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Escape)
            {
                Close();
                if (quickSearchTool)
                {
                    quickSearchTool.Focus();
                }
                return;
            }

            HandleKeyboardNavigation();

            m_ToggleFilterNextIndex = 0;

            GUI.Box(new Rect(0, 0, position.width, position.height), GUIContent.none, Styles.panelBorder);
            DrawHeader();
            GUILayout.Label(GUIContent.none, Styles.separator);

            m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos);

            foreach (var providerDesc in SearchService.Filter.providerFilters.OrderBy(f => f.priority))
            {
                DrawSectionHeader(providerDesc);
                if (providerDesc.isExpanded)
                {
                    DrawSubCategories(providerDesc);
                }
            }

            m_ToggleFilterCount = m_ToggleFilterNextIndex;

            GUILayout.EndScrollView();
        }
Пример #2
0
        private IEnumerator PrepareSearchTool(QuickSearchTool 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);
        }