示例#1
0
        private GUIStyle GetStyle(string text)
        {
            if (text.StartsWith("+++") ||
                text.StartsWith("---") ||
                text.StartsWith("diff ") ||
                text.StartsWith("Date:"))
            {
                return(ColorLabel.Get(Color.yellow));
            }

            if (text.StartsWith("index ") ||
                text.StartsWith("Author:") ||
                text.StartsWith("commit "))
            {
                return(ColorLabel.Get(Color.blue));
            }

            if (text.StartsWith("+"))
            {
                return(ColorLabel.Get(new Color(0, 0.7f, 0.1f)));
            }

            if (text.StartsWith("-"))
            {
                return(ColorLabel.Get(Color.red));
            }

            if (text.StartsWith("@@"))
            {
                return(ColorLabel.Get(Color.magenta));
            }


            return(ColorLabel.Get(Color.black));
        }
示例#2
0
 private void RowAction(Rect rect, GitTreeViewItem item)
 {
     for (var i = 0; i < MaxWidth.Length; i++)
     {
         rect.width = MaxWidth[i] + EditorGUIUtility.standardVerticalSpacing * 4;
         EditorGUI.LabelField(rect, item[i], ColorLabel.Get(colors[i]));
         rect.xMin += rect.width;
     }
 }
示例#3
0
        private GUIStyle GetStyle(GitTreeViewItem item)
        {
            if (item.displayName == _current)
            {
                return(EditorStyles.boldLabel);
            }

            if (item.displayName.StartsWith("origin/"))
            {
                return(ColorLabel.Get(Color.yellow));
            }

            return(ColorLabel.Get(Color.blue));
        }
示例#4
0
        private void Row(Rect rect, GitTreeViewItem item)
        {
            EditorGUI.LabelField(
                new Rect(4, rect.y, 12, rect.height),
                $"{item.GetStatusText()}",
                ColorLabel.Get(Color.magenta));

            rect.xMin += (item.depth + 1) * TreeView.DepthIndentWidth;

            EditorGUI.LabelField(
                rect,
                item.displayName,
                item.depth == 0 ?
                EditorStyles.boldLabel :
                EditorStyles.label
                );
        }