public StylesDebugger(DebuggerSelection debuggerSelection)
        {
            m_DebuggerSelection = debuggerSelection;
            m_DebuggerSelection.onPanelDebugChanged      += pdbg => m_PanelDebug = pdbg;
            m_DebuggerSelection.onSelectedElementChanged += element => selectedElement = element;

            m_PanelDebug    = m_DebuggerSelection.panelDebug;
            selectedElement = m_DebuggerSelection.element;

            m_ScrollView = new ScrollView();

            m_BoxModelView = new BoxModelView();
            m_ScrollView.Add(m_BoxModelView);

            m_IMGUIStylesDebugger = new IMGUIContainer(OnGUI);
            m_ScrollView.Add(m_IMGUIStylesDebugger);

            m_StylePropertyDebugger = new StylePropertyDebugger(selectedElement);
            m_ScrollView.Add(m_StylePropertyDebugger);

            Add(m_ScrollView);
        }
Esempio n. 2
0
        public DebuggerTreeView(DebuggerSelection debuggerSelection, Action <VisualElement> selectElementCallback)
        {
            this.focusable = true;

            m_DebuggerSelection = debuggerSelection;
            m_DebuggerSelection.onPanelDebugChanged      += pdbg => RebuildTree(pdbg);
            m_DebuggerSelection.onSelectedElementChanged += element => SelectElement(element, null);

            m_SelectElementCallback = selectElementCallback;
            hierarchyHasChanged     = true;

            m_SearchResultsHightlights = new List <VisualElement>();

            this.RegisterCallback <FocusEvent>(e => m_TreeView?.Focus());

            m_TreeViewHoverOverlay = new HighlightOverlayPainter();

            m_Container = new VisualElement();
            m_Container.style.flexGrow = 1f;
            Add(m_Container);

            m_SearchBar = new DebuggerSearchBar(this);
            Add(m_SearchBar);
        }