refactor: rename Models.CustomColorSchema to Models.ThemeOverrides because it do NOT contains only colors currently.

This commit is contained in:
leo 2024-07-08 16:21:57 +08:00
parent af388bad60
commit 16d9b627f0
No known key found for this signature in database
12 changed files with 49 additions and 74 deletions

View file

@ -108,30 +108,21 @@ namespace SourceGit.Models
private set;
} = new List<Pen>();
public static void SetDefaultPens()
public static void SetDefaultPens(double thickness = 1.5)
{
SetPenColors(_defaultPenColors);
SetPens(_defaultPenColors, thickness);
}
public static void SetPenColors(List<Color> colors)
public static void SetPens(List<Color> colors, double thickness)
{
Pens.Clear();
foreach (var c in colors)
Pens.Add(new Pen(c.ToUInt32(), 2));
Pens.Add(new Pen(c.ToUInt32(), thickness));
_penCount = colors.Count;
}
public static void SetPenThickness(double value)
{
_penThickness = value;
}
public static double GetPenThickness()
{
return _penThickness;
}
public static CommitGraph Parse(List<Commit> commits)
{
double UNIT_WIDTH = 12;
@ -277,7 +268,6 @@ namespace SourceGit.Models
return temp;
}
private static double _penThickness = 1;
private static int _penCount = 0;
private static readonly List<Color> _defaultPenColors = [
Colors.Orange,

View file

@ -1,11 +0,0 @@
using System.Collections.Generic;
namespace SourceGit.Models
{
public class CustomColorSchema
{
public Dictionary<string, string> Basic { get; set; } = new Dictionary<string, string>();
public List<string> Graph { get; set; } = new List<string>();
public Dictionary<string,string> General { get; set; } = new Dictionary<string, string>();
}
}

View file

@ -0,0 +1,11 @@
using System.Collections.Generic;
namespace SourceGit.Models
{
public class ThemeOverrides
{
public Dictionary<string, string> BasicColors { get; set; } = new Dictionary<string, string>();
public double GraphPenThickness { get; set; } = 1.5;
public List<string> GraphColors { get; set; } = new List<string>();
}
}