void OnGUI()
        {
            TopToolbar(m_DisplayAreaRect);

            var headerState = ProfileTreeView.CreateDefaultMultiColumnHeaderState(settings);

            if (MultiColumnHeaderState.CanOverwriteSerializedFields(m_Mchs, headerState))
            {
                MultiColumnHeaderState.OverwriteSerializedFields(m_Mchs, headerState);
            }
            m_Mchs = headerState;

            if (m_ProfileTreeView == null || m_Mchs.columns.Length != m_ProfileTreeView.multiColumnHeader.state.columns.Length ||
                HeaderNameChanged())
            {
                m_Pch = new ProfileColumnHeader(m_Mchs, this);
                if (m_TreeState == null)
                {
                    m_TreeState = new TreeViewState();
                }
                m_ProfileTreeView = new ProfileTreeView(m_TreeState, m_Mchs, m_Pch, this);
            }
            m_ProfileTreeView.OnGUI(new Rect(0, k_ToolbarHeight, position.width, position.height - k_ToolbarHeight));
        }
Example #2
0
        public ProfileTreeView(TreeViewState state, MultiColumnHeaderState multiColumnHeaderState, ProfileColumnHeader profileColumnHeader, ProfileWindow window) :
            base(state, profileColumnHeader)
        {
            m_Mchs    = multiColumnHeaderState;
            m_Window  = window;
            rowHeight = kRowHeights;
            showAlternatingRowBackgrounds = true;
            showBorder = true;
            profileColumnHeader.sortingChanged += OnSortingChanged;

            Reload();
        }