mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
commit
af388bad60
4 changed files with 30 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
|
@ -188,6 +189,22 @@ namespace SourceGit
|
|||
Models.CommitGraph.SetPenColors(penColors);
|
||||
}
|
||||
|
||||
foreach (var kv in schema.General)
|
||||
{
|
||||
if (kv.Key.Equals("Pen.Thickness", StringComparison.Ordinal))
|
||||
{
|
||||
double thick = Models.CommitGraph.GetPenThickness();
|
||||
try
|
||||
{
|
||||
thick = double.Parse(kv.Value, CultureInfo.InvariantCulture);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
Models.CommitGraph.SetPenThickness(thick);
|
||||
}
|
||||
}
|
||||
|
||||
app.Resources.MergedDictionaries.Add(resDic);
|
||||
app._colorOverrides = resDic;
|
||||
}
|
||||
|
|
|
@ -123,6 +123,15 @@ namespace SourceGit.Models
|
|||
_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;
|
||||
|
@ -268,6 +277,7 @@ namespace SourceGit.Models
|
|||
return temp;
|
||||
}
|
||||
|
||||
private static double _penThickness = 1;
|
||||
private static int _penCount = 0;
|
||||
private static readonly List<Color> _defaultPenColors = [
|
||||
Colors.Orange,
|
||||
|
|
|
@ -6,5 +6,6 @@ namespace SourceGit.Models
|
|||
{
|
||||
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>();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -158,6 +158,8 @@ namespace SourceGit.Views
|
|||
|
||||
var geo = new StreamGeometry();
|
||||
var pen = Models.CommitGraph.Pens[line.Color];
|
||||
pen.Thickness = Models.CommitGraph.GetPenThickness();
|
||||
|
||||
using (var ctx = geo.Open())
|
||||
{
|
||||
var started = false;
|
||||
|
|
Loading…
Reference in a new issue