Skip to content

Commit e7c52d0

Browse files
committed
Merge branch 'release/v8.16'
2 parents 38fd30d + f4a70ba commit e7c52d0

File tree

81 files changed

+1873
-1283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1873
-1283
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Opensource Git GUI client.
77
* Supports Windows/macOS/Linux
88
* Opensource/Free
99
* Fast
10-
* English/简体中文
10+
* English/简体中文/繁體中文
1111
* Built-in light/dark themes
1212
* Visual commit graph
1313
* Supports SSH access with each remote
@@ -75,6 +75,7 @@ This app supports open repository in external tools listed in the table below.
7575

7676
> * You can set the given environment variable for special tool if it can NOT be found by this app automatically.
7777
> * Installing `JetBrains Toolbox` will help this app to find other JetBrains tools installed on your device.
78+
> * On macOS, you may need to use `launchctl setenv` to make sure the app can read these environment variables.
7879
7980
## Screenshots
8081

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.15
1+
8.16

build/resources/app/App.plist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
<string>SOURCE_GIT_VERSION.0</string>
1313
<key>LSMinimumSystemVersion</key>
1414
<string>10.12</string>
15+
<key>LSEnvironment</key>
16+
<dict>
17+
<key>PATH</key>
18+
<string>/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
19+
</dict>
1520
<key>CFBundleExecutable</key>
1621
<string>SourceGit</string>
1722
<key>CFBundleInfoDictionaryVersion</key>

src/App.JsonCodeGen.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
using System.Text.Json.Serialization;
1+
using System.Collections.Generic;
2+
using System.Text.Json.Serialization;
23

34
namespace SourceGit
45
{
56
[JsonSourceGenerationOptions(WriteIndented = true, IgnoreReadOnlyFields = true, IgnoreReadOnlyProperties = true)]
67
[JsonSerializable(typeof(Models.Version))]
78
[JsonSerializable(typeof(Models.JetBrainsState))]
9+
[JsonSerializable(typeof(Dictionary<string, string>))]
810
[JsonSerializable(typeof(ViewModels.Preference))]
911
internal partial class JsonCodeGen : JsonSerializerContext { }
1012
}

src/App.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
<ResourceInclude x:Key="en_US" Source="/Resources/Locales/en_US.axaml"/>
1515
<ResourceInclude x:Key="zh_CN" Source="/Resources/Locales/zh_CN.axaml"/>
16+
<ResourceInclude x:Key="zh_TW" Source="/Resources/Locales/zh_TW.axaml"/>
1617
</ResourceDictionary>
1718
</Application.Resources>
1819

src/App.axaml.cs

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -132,32 +132,48 @@ public static void SetLocale(string localeKey)
132132
var app = Current as App;
133133
var targetLocale = app.Resources[localeKey] as ResourceDictionary;
134134
if (targetLocale == null || targetLocale == app._activeLocale)
135-
{
136135
return;
137-
}
138136

139137
if (app._activeLocale != null)
140-
{
141138
app.Resources.MergedDictionaries.Remove(app._activeLocale);
142-
}
143139

144140
app.Resources.MergedDictionaries.Add(targetLocale);
145141
app._activeLocale = targetLocale;
146142
}
147143

148-
public static void SetTheme(string theme)
144+
public static void SetTheme(string theme, string colorsFile)
149145
{
146+
var app = Current as App;
147+
150148
if (theme.Equals("Light", StringComparison.OrdinalIgnoreCase))
151-
{
152-
Current.RequestedThemeVariant = ThemeVariant.Light;
153-
}
149+
app.RequestedThemeVariant = ThemeVariant.Light;
154150
else if (theme.Equals("Dark", StringComparison.OrdinalIgnoreCase))
151+
app.RequestedThemeVariant = ThemeVariant.Dark;
152+
else
153+
app.RequestedThemeVariant = ThemeVariant.Default;
154+
155+
if (app._colorOverrides != null)
155156
{
156-
Current.RequestedThemeVariant = ThemeVariant.Dark;
157+
app.Resources.MergedDictionaries.Remove(app._colorOverrides);
158+
app._colorOverrides = null;
157159
}
158-
else
160+
161+
if (!string.IsNullOrEmpty(colorsFile) && File.Exists(colorsFile))
159162
{
160-
Current.RequestedThemeVariant = ThemeVariant.Default;
163+
try
164+
{
165+
var resDic = new ResourceDictionary();
166+
167+
var schema = JsonSerializer.Deserialize(File.ReadAllText(colorsFile), JsonCodeGen.Default.DictionaryStringString);
168+
foreach (var kv in schema)
169+
resDic[kv.Key] = Color.Parse(kv.Value);
170+
171+
app.Resources.MergedDictionaries.Add(resDic);
172+
app._colorOverrides = resDic;
173+
}
174+
catch
175+
{
176+
}
161177
}
162178
}
163179

@@ -166,9 +182,7 @@ public static async void CopyText(string data)
166182
if (Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
167183
{
168184
if (desktop.MainWindow.Clipboard is { } clipbord)
169-
{
170185
await clipbord.SetTextAsync(data);
171-
}
172186
}
173187
}
174188

@@ -256,7 +270,7 @@ public override void Initialize()
256270
var pref = ViewModels.Preference.Instance;
257271

258272
SetLocale(pref.Locale);
259-
SetTheme(pref.Theme);
273+
SetTheme(pref.Theme, pref.ColorOverrides);
260274
}
261275

262276
public override void OnFrameworkInitializationCompleted()
@@ -300,6 +314,7 @@ private static void ShowSelfUpdateResult(object data)
300314
}
301315

302316
private ResourceDictionary _activeLocale = null;
317+
private ResourceDictionary _colorOverrides = null;
303318
private Models.INotificationReceiver _notificationReceiver = null;
304319
}
305320
}

src/Commands/QueryBranches.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ protected override void OnReadline(string line)
5252
var refName = parts[0];
5353
if (refName.EndsWith("/HEAD", StringComparison.Ordinal))
5454
return;
55-
55+
5656
if (refName.StartsWith(PREFIX_DETACHED, StringComparison.Ordinal))
5757
{
5858
branch.IsHead = true;
5959
}
60-
60+
6161
if (refName.StartsWith(PREFIX_LOCAL, StringComparison.Ordinal))
6262
{
6363
branch.Name = refName.Substring(PREFIX_LOCAL.Length);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace SourceGit.Commands
2+
{
3+
public class QueryCommitFullMessage : Command
4+
{
5+
public QueryCommitFullMessage(string repo, string sha)
6+
{
7+
WorkingDirectory = repo;
8+
Context = repo;
9+
Args = $"show --no-show-signature --pretty=format:%B -s {sha}";
10+
}
11+
12+
public string Result()
13+
{
14+
var rs = ReadToEnd();
15+
if (rs.IsSuccess) return rs.StdOut.TrimEnd();
16+
return string.Empty;
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)