mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 21:24:59 +00:00
refactor: rename Models.CustomColorSchema
to Models.ThemeOverrides
because it do NOT contains only colors currently.
This commit is contained in:
parent
af388bad60
commit
16d9b627f0
12 changed files with 49 additions and 74 deletions
|
@ -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,
|
||||
|
|
|
@ -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>();
|
||||
}
|
||||
}
|
11
src/Models/ThemeOverrides.cs
Normal file
11
src/Models/ThemeOverrides.cs
Normal 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>();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue