Skip to content

Commit

Permalink
Merge branch 'release/v8.21'
Browse files Browse the repository at this point in the history
  • Loading branch information
love-linger committed Jul 15, 2024
2 parents 7d3f228 + 19c42fb commit 791b5bd
Show file tree
Hide file tree
Showing 200 changed files with 3,783 additions and 3,368 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -604,3 +604,4 @@ build/*.zip
build/*.tar.gz
build/*.deb
build/*.rpm
build/*.AppImage
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ You can download the latest stable from [Releases](https://github.com/sourcegit-

This software creates a folder `$"{System.Environment.SpecialFolder.ApplicationData}/SourceGit"`, which is platform-dependent, to store user settings, downloaded avatars and crash logs.

| OS | PATH |
| --- | --- |
| Windows | `C:\Users\USER_NAME\AppData\Roaming\SourceGit` |
| Linux | `${HOME}/.config/SourceGit` |
| macOS | `${HOME}/Library/Application Support/SourceGit` |
| OS | PATH |
|---------|-------------------------------------------------|
| Windows | `C:\Users\USER_NAME\AppData\Roaming\SourceGit` |
| Linux | `${HOME}/.config/SourceGit` |
| macOS | `${HOME}/Library/Application Support/SourceGit` |

For **Windows** users:

Expand All @@ -74,13 +74,13 @@ For **Linux** users:

This app supports open repository in external tools listed in the table below.

| Tool | Windows | macOS | Linux | Environment Variable |
| --- | --- | --- | --- | --- |
| Visual Studio Code | YES | YES | YES | VSCODE_PATH |
| Visual Studio Code - Insiders | YES | YES | YES | VSCODE_INSIDERS_PATH |
| VSCodium | YES | YES | YES | VSCODIUM_PATH |
| JetBrains Fleet | YES | YES | YES | FLEET_PATH |
| Sublime Text | YES | YES | YES | SUBLIME_TEXT_PATH |
| Tool | Windows | macOS | Linux | Environment Variable |
|-------------------------------|---------|-------|-------|----------------------|
| Visual Studio Code | YES | YES | YES | VSCODE_PATH |
| Visual Studio Code - Insiders | YES | YES | YES | VSCODE_INSIDERS_PATH |
| VSCodium | YES | YES | YES | VSCODIUM_PATH |
| JetBrains Fleet | YES | YES | YES | FLEET_PATH |
| Sublime Text | YES | YES | YES | SUBLIME_TEXT_PATH |

* You can set the given environment variable for special tool if it can NOT be found by this app automatically.
* Installing `JetBrains Toolbox` will help this app to find other JetBrains tools installed on your device.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.20
8.21
62 changes: 58 additions & 4 deletions src/App.JsonCodeGen.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,67 @@
using System.Collections.Generic;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;

using Avalonia.Controls;
using Avalonia.Media;

namespace SourceGit
{
[JsonSourceGenerationOptions(WriteIndented = true, IgnoreReadOnlyFields = true, IgnoreReadOnlyProperties = true)]
[JsonSerializable(typeof(List<Models.InteractiveRebaseJob>))]
public class ColorConverter : JsonConverter<Color>
{
public override Color Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return Color.Parse(reader.GetString());
}

public override void Write(Utf8JsonWriter writer, Color value, JsonSerializerOptions options)
{
writer.WriteStringValue(value.ToString());
}
}

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)
{
var size = reader.GetDouble();
return new GridLength(size, GridUnitType.Pixel);
}

public override void Write(Utf8JsonWriter writer, GridLength value, JsonSerializerOptions options)
{
writer.WriteNumberValue(value.Value);
}
}

[JsonSourceGenerationOptions(
WriteIndented = true,
IgnoreReadOnlyFields = true,
IgnoreReadOnlyProperties = true,
Converters = [
typeof(ColorConverter),
typeof(FontFamilyConverter),
typeof(GridLengthConverter),
]
)]
[JsonSerializable(typeof(Models.InteractiveRebaseJobCollection))]
[JsonSerializable(typeof(Models.JetBrainsState))]
[JsonSerializable(typeof(Models.ThemeOverrides))]
[JsonSerializable(typeof(Models.Version))]
[JsonSerializable(typeof(Models.CustomColorSchema))]
[JsonSerializable(typeof(ViewModels.Preference))]
[JsonSerializable(typeof(ViewModels.RepositorySettings))]
internal partial class JsonCodeGen : JsonSerializerContext { }
Expand Down
1 change: 0 additions & 1 deletion src/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<Application.Styles>
<FluentTheme />
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml"/>
<StyleInclude Source="avares://Avalonia.Controls.TreeDataGrid/Themes/Fluent.axaml"/>
<StyleInclude Source="avares://AvaloniaEdit/Themes/Fluent/AvaloniaEdit.xaml" />
<StyleInclude Source="/Resources/Styles.axaml"/>
</Application.Styles>
Expand Down
Loading

0 comments on commit 791b5bd

Please sign in to comment.