mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
refactor: rewrite the font configuration (#366)
* input font name directly instead of a font picker because localized font family name is not supported by Avalonia * fallback monospace font to default font * remove unused code
This commit is contained in:
parent
24dde77548
commit
9057b71f2d
20 changed files with 96 additions and 169 deletions
|
@ -20,20 +20,6 @@ namespace SourceGit
|
|||
}
|
||||
}
|
||||
|
||||
public class FontFamilyConverter : JsonConverter<FontFamily>
|
||||
{
|
||||
public override FontFamily Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
var name = reader.GetString();
|
||||
return new FontFamily(name);
|
||||
}
|
||||
|
||||
public override void Write(Utf8JsonWriter writer, FontFamily value, JsonSerializerOptions options)
|
||||
{
|
||||
writer.WriteStringValue(value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public class GridLengthConverter : JsonConverter<GridLength>
|
||||
{
|
||||
public override GridLength Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
|
@ -54,7 +40,6 @@ namespace SourceGit
|
|||
IgnoreReadOnlyProperties = true,
|
||||
Converters = [
|
||||
typeof(ColorConverter),
|
||||
typeof(FontFamilyConverter),
|
||||
typeof(GridLengthConverter),
|
||||
]
|
||||
)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue