Ejemplo n.º 1
0
        static void ChangeCategoryTreeViewItemGUI(
            Rect rowRect,
            float rowHeight,
            ChangeCategoryTreeViewItem item,
            bool isSelected,
            bool isFocused)
        {
            Texture icon  = GetChangeCategoryIcon(item.Category);
            string  label = item.Category.GetHeaderText();

            DrawTreeViewItem.ForCategoryItem(
                rowRect,
                rowHeight,
                item.depth,
                icon, label,
                isSelected,
                isFocused);
        }
Ejemplo n.º 2
0
        static void AddChangeCategory(
            TreeViewItem parentItem,
            IDiffCategory category,
            List <TreeViewItem> rows,
            TreeViewItemIds <IDiffCategory, ITreeViewNode> treeViewItemIds,
            TreeView treeView,
            bool expandCategories)
        {
            int categoryId;

            if (!treeViewItemIds.TryGetCategoryItemId(category, out categoryId))
            {
                categoryId = treeViewItemIds.AddCategoryItem(category);
            }

            ChangeCategoryTreeViewItem changeCategoryTreeViewItem =
                new ChangeCategoryTreeViewItem(
                    categoryId,
                    parentItem.depth + 1,
                    (ChangeCategory)category);

            parentItem.AddChild(changeCategoryTreeViewItem);
            rows.Add(changeCategoryTreeViewItem);

            if (!expandCategories &&
                !treeView.IsExpanded(changeCategoryTreeViewItem.id))
            {
                return;
            }

            AddClientDiffs(
                changeCategoryTreeViewItem,
                (ITreeViewNode)category,
                rows,
                treeViewItemIds);
        }