Merge branch 'release/v8.9'

This commit is contained in:
leo 2024-04-22 09:06:20 +08:00
commit 7e4e339a0c
32 changed files with 287 additions and 149 deletions

19
.gitignore vendored
View file

@ -596,14 +596,11 @@ package-lock.json
*.db-shm *.db-shm
*.db-wal *.db-wal
## SourceGit ### # SourceGit output files
build/resources/
# Output folders. build/SourceGit/
[Bb]uild/[Ss]ource[Gg]it/ build/SourceGit.app/
[Bb]uild/[Ss]ource[Gg]it.app/ build/*.zip
build/*.tar.gz
# Files build/*.deb
SourceGit.win-x64.zip build/*.rpm
SourceGit.linux-x64.tar.gz
SourceGit.osx-x64.zip
SourceGit.osx-arm64.zip

View file

@ -30,18 +30,18 @@ Opensource Git GUI client.
## How to use ## How to use
**To use this tool, you need to install Git first.** **To use this tool, you need to install Git(>=2.23.0) first.**
You can download the latest stable from [Releases](https://github.com/sourcegit-scm/sourcegit/releases/latest) or download workflow artifacts from [Github Actions](https://github.com/sourcegit-scm/sourcegit/actions) to try this app based on latest commits. You can download the latest stable from [Releases](https://github.com/sourcegit-scm/sourcegit/releases/latest) or download workflow artifacts from [Github Actions](https://github.com/sourcegit-scm/sourcegit/actions) to try this app based on latest commits.
For **Windows** users: For **Windows** users:
* **MSYS Git is NOT supported**. Please use official [Git for Windows](https://git-scm.com/download/win) instead. * **MSYS Git is NOT supported**. Please use official [Git for Windows](https://git-scm.com/download/win) instead.
* `Source.win-x64.zip` may be reported as virus by Windows Defender. I don't know why. I have manually tested the zip to be uploaded using Windows Defender before uploading and no virus was found. If you have installed .NET 8 SDK locally, I suggest you to compile it yourself. And if you have any idea about how to fix this, please open an issue. * `sourcegit_x.y.win-x64.zip` may be reported as virus by Windows Defender. I don't know why. I have manually tested the zip to be uploaded using Windows Defender before uploading and no virus was found. If you have installed .NET 8 SDK locally, I suggest you to compile it yourself. And if you have any idea about how to fix this, please open an issue.
For **macOS** users: For **macOS** users:
* Download `SourceGit.osx-x64.zip` or `SourceGit.osx-arm64.zip` from Releases. `x64` for Intel and `arm64` for Apple Silicon. * Download `sourcegit_x.y.osx-x64.zip` or `sourcegit_x.y.osx-arm64.zip` from Releases. `x64` for Intel and `arm64` for Apple Silicon.
* Move `SourceGit.app` to `Applications` folder. * Move `SourceGit.app` to `Applications` folder.
* Make sure your mac trusts all software from anywhere. For more information, search `spctl --master-disable`. * Make sure your mac trusts all software from anywhere. For more information, search `spctl --master-disable`.
* Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your mac. * Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your mac.
@ -50,9 +50,8 @@ For **macOS** users:
For **Linux** users: For **Linux** users:
* `xdg-open` must be installed to support open native file manager. * `xdg-open` must be installed to support open native file manager.
* Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your linux, and it requires `ttf-mscorefonts-installer` installed. * Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your linux.
* Maybe you need to set environment variable `AVALONIA_SCREEN_SCALE_FACTORS`. See https://github.com/AvaloniaUI/Avalonia/wiki/Configuring-X11-per-monitor-DPI. * Maybe you need to set environment variable `AVALONIA_SCREEN_SCALE_FACTORS`. See https://github.com/AvaloniaUI/Avalonia/wiki/Configuring-X11-per-monitor-DPI.
* Modify `SourceGit.desktop.template` (replace SOURCEGIT_LOCAL_FOLDER with real path) and move it into `~/.local/share/applications`.
## External Tools ## External Tools
@ -82,5 +81,5 @@ You can set the given environment variable for special tool if it can NOT be fou
Thanks to all the people who contribute. Thanks to all the people who contribute.
<a href="https://github.com/sourcegit-scm/sourcegit/graphs/contributors"> <a href="https://github.com/sourcegit-scm/sourcegit/graphs/contributors">
<img src="https://contrib.rocks/image?repo=sourcegit-scm/sourcegit&t=1" /> <img src="https://contrib.rocks/image?repo=sourcegit-scm/sourcegit&t=2" />
</a> </a>

View file

@ -13,11 +13,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{773082AC
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "resources", "resources", "{FD384607-ED99-47B7-AF31-FB245841BC92}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "resources", "resources", "{FD384607-ED99-47B7-AF31-FB245841BC92}"
ProjectSection(SolutionItems) = preProject
build\resources\App.icns = build\resources\App.icns
build\resources\App.plist = build\resources\App.plist
build\resources\SourceGit.desktop.template = build\resources\SourceGit.desktop.template
EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{F45A9D95-AF25-42D8-BBAC-8259C9EEE820}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{F45A9D95-AF25-42D8-BBAC-8259C9EEE820}"
EndProject EndProject
@ -36,6 +31,48 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "files", "files", "{3AB707DB
global.json = global.json global.json = global.json
LICENSE = LICENSE LICENSE = LICENSE
README.md = README.md README.md = README.md
VERSION = VERSION
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "app", "app", "{ABC98884-F023-4EF4-A9C9-5DE9452BE955}"
ProjectSection(SolutionItems) = preProject
build\resources\app\App.icns = build\resources\app\App.icns
build\resources\app\App.plist = build\resources\app\App.plist
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_common", "_common", "{04FD74B1-FBDB-496E-A48F-3D59D71FF952}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "usr", "usr", "{76639799-54BC-45E8-BD90-F45F63ACD11D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "bin", "bin", "{2E27E952-846B-4D75-A426-D22151277864}"
ProjectSection(SolutionItems) = preProject
build\resources\_common\usr\bin\sourcegit = build\resources\_common\usr\bin\sourcegit
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "share", "share", "{A3ABAA7C-EE14-4448-B466-6E69C1347E7D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "applications", "applications", "{2AF28D3B-14A8-46A8-B828-157FAAB1B06F}"
ProjectSection(SolutionItems) = preProject
build\resources\_common\usr\share\applications\sourcegit.desktop = build\resources\_common\usr\share\applications\sourcegit.desktop
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "icons", "icons", "{7166EC6C-17F5-4B5E-B38E-1E53C81EACF6}"
ProjectSection(SolutionItems) = preProject
build\resources\_common\usr\share\icons\sourcegit.png = build\resources\_common\usr\share\icons\sourcegit.png
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "deb", "deb", "{9C2F0CDA-B56E-44A5-94B6-F3EA7AC20CDC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DEBIAN", "DEBIAN", "{F101849D-BDB7-40D4-A516-751150C3CCFC}"
ProjectSection(SolutionItems) = preProject
build\resources\deb\DEBIAN\control = build\resources\deb\DEBIAN\control
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "rpm", "rpm", "{9BA0B044-0CC9-46F8-B551-204F149BF45D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SPECS", "SPECS", "{7802CD7A-591B-4EDD-96F8-9BF3F61692E4}"
ProjectSection(SolutionItems) = preProject
build\resources\rpm\SPECS\build.spec = build\resources\rpm\SPECS\build.spec
EndProjectSection EndProjectSection
EndProject EndProject
Global Global
@ -56,6 +93,17 @@ Global
{2091C34D-4A17-4375-BEF3-4D60BE8113E4} = {49A7C2D6-558C-4FAA-8F5D-EEE81497AED7} {2091C34D-4A17-4375-BEF3-4D60BE8113E4} = {49A7C2D6-558C-4FAA-8F5D-EEE81497AED7}
{FD384607-ED99-47B7-AF31-FB245841BC92} = {773082AC-D9C8-4186-8521-4B6A7BEE6158} {FD384607-ED99-47B7-AF31-FB245841BC92} = {773082AC-D9C8-4186-8521-4B6A7BEE6158}
{67B6D05F-A000-40BA-ADB4-C9065F880D7B} = {F45A9D95-AF25-42D8-BBAC-8259C9EEE820} {67B6D05F-A000-40BA-ADB4-C9065F880D7B} = {F45A9D95-AF25-42D8-BBAC-8259C9EEE820}
{ABC98884-F023-4EF4-A9C9-5DE9452BE955} = {FD384607-ED99-47B7-AF31-FB245841BC92}
{04FD74B1-FBDB-496E-A48F-3D59D71FF952} = {FD384607-ED99-47B7-AF31-FB245841BC92}
{76639799-54BC-45E8-BD90-F45F63ACD11D} = {04FD74B1-FBDB-496E-A48F-3D59D71FF952}
{2E27E952-846B-4D75-A426-D22151277864} = {76639799-54BC-45E8-BD90-F45F63ACD11D}
{A3ABAA7C-EE14-4448-B466-6E69C1347E7D} = {76639799-54BC-45E8-BD90-F45F63ACD11D}
{2AF28D3B-14A8-46A8-B828-157FAAB1B06F} = {A3ABAA7C-EE14-4448-B466-6E69C1347E7D}
{7166EC6C-17F5-4B5E-B38E-1E53C81EACF6} = {A3ABAA7C-EE14-4448-B466-6E69C1347E7D}
{9C2F0CDA-B56E-44A5-94B6-F3EA7AC20CDC} = {FD384607-ED99-47B7-AF31-FB245841BC92}
{F101849D-BDB7-40D4-A516-751150C3CCFC} = {9C2F0CDA-B56E-44A5-94B6-F3EA7AC20CDC}
{9BA0B044-0CC9-46F8-B551-204F149BF45D} = {FD384607-ED99-47B7-AF31-FB245841BC92}
{7802CD7A-591B-4EDD-96F8-9BF3F61692E4} = {9BA0B044-0CC9-46F8-B551-204F149BF45D}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7FF1B9C6-B5BF-4A50-949F-4B407A0E31C9} SolutionGuid = {7FF1B9C6-B5BF-4A50-949F-4B407A0E31C9}

1
VERSION Normal file
View file

@ -0,0 +1 @@
8.9

View file

@ -1,8 +1,31 @@
#!/bin/sh #!/bin/sh
rm -rf SourceGit version=`cat ../VERSION`
# Cleanup
rm -rf SourceGit *.tar.gz resources/deb/opt *.deb *.rpm
# Compile
dotnet publish ../src/SourceGit.csproj -c Release -r linux-x64 -o SourceGit -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained dotnet publish ../src/SourceGit.csproj -c Release -r linux-x64 -o SourceGit -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
cp resources/SourceGit.desktop.template SourceGit/SourceGit.desktop.template mv SourceGit/SourceGit SourceGit/sourcegit
cp resources/App.icns SourceGit/SourceGit.icns rm -f SourceGit/*.dbg
tar -zcvf SourceGit.linux-x64.tar.gz --exclude="*/*.dbg" SourceGit
# General Linux archive
tar -zcvf sourcegit_${version}.linux-x64.tar.gz SourceGit
# Debain/Ubuntu package
mkdir -p resources/deb/opt/sourcegit/
mkdir -p resources/deb/usr/bin
mkdir -p resources/deb/usr/share/applications
mkdir -p resources/deb/usr/share/icons
cp -f SourceGit/* resources/deb/opt/sourcegit/
cp -r resources/_common/usr resources/deb/
chmod -R 755 resources/deb
sed -i "2s/.*/Version: ${version}/g" resources/deb/DEBIAN/control
dpkg-deb --build resources/deb ./sourcegit_${version}-1_amd64.deb
# Redhat/CentOS/Fedora package
rpmbuild -bb --target=x86_64 resources/rpm/SPECS/build.spec --define "_topdir `pwd`/resources/rpm" --define "_version ${version}"
mv resources/rpm/RPMS/x86_64/sourcegit-${version}-1.x86_64.rpm .
rm -rf SourceGit rm -rf SourceGit

View file

@ -1,17 +1,21 @@
#!/bin/sh #!/bin/sh
rm -rf SourceGit.app version=`cat ../VERSION`
rm -rf SourceGit.app *.zip
mkdir -p SourceGit.app/Contents/Resources mkdir -p SourceGit.app/Contents/Resources
cp resources/App.plist SourceGit.app/Contents/Info.plist cp resources/app/App.icns SourceGit.app/Contents/Resources/App.icns
cp resources/App.icns SourceGit.app/Contents/Resources/App.icns sed "s/SOURCE_GIT_VERSION/${version}/g" resources/app/App.plist > SourceGit.app/Contents/Info.plist
mkdir -p SourceGit.app/Contents/MacOS mkdir -p SourceGit.app/Contents/MacOS
dotnet publish ../src/SourceGit.csproj -c Release -r osx-arm64 -o SourceGit.app/Contents/MacOS -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained dotnet publish ../src/SourceGit.csproj -c Release -r osx-arm64 -o SourceGit.app/Contents/MacOS -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
zip SourceGit.osx-arm64.zip -r SourceGit.app -x "*/*\.dsym/*" zip sourcegit_${version}.osx-arm64.zip -r SourceGit.app -x "*/*\.dsym/*"
rm -rf SourceGit.app/Contents/MacOS rm -rf SourceGit.app/Contents/MacOS
mkdir -p SourceGit.app/Contents/MacOS mkdir -p SourceGit.app/Contents/MacOS
dotnet publish ../src/SourceGit.csproj -c Release -r osx-x64 -o SourceGit.app/Contents/MacOS -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained dotnet publish ../src/SourceGit.csproj -c Release -r osx-x64 -o SourceGit.app/Contents/MacOS -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
zip SourceGit.osx-x64.zip -r SourceGit.app -x "*/*\.dsym/*" zip sourcegit_${version}.osx-x64.zip -r SourceGit.app -x "*/*\.dsym/*"
rm -rf SourceGit.app

View file

@ -1,13 +1,13 @@
$version = Get-Content ..\VERSION
if (Test-Path SourceGit) { if (Test-Path SourceGit) {
Remove-Item SourceGit -Recurse -Force Remove-Item SourceGit -Recurse -Force
} }
if (Test-Path SourceGit.win-x64.zip) { Remove-Item *.zip -Force
Remove-Item SourceGit.win-x64.zip -Force
}
dotnet publish ..\src\SourceGit.csproj -c Release -r win-x64 -o SourceGit -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained dotnet publish ..\src\SourceGit.csproj -c Release -r win-x64 -o SourceGit -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
Remove-Item SourceGit\*.pdb -Force Remove-Item SourceGit\*.pdb -Force
Compress-Archive -Path SourceGit -DestinationPath SourceGit.win-x64.zip Compress-Archive -Path SourceGit -DestinationPath "sourcegit_$version.win-x64.zip"

View file

@ -1,7 +0,0 @@
[Desktop Entry]
Name=SourceGit
Comment=Free & OpenSource Git Client
Exec=SOURCEGIT_LOCAL_FOLDER/SourceGit
Icon=SOURCEGIT_LOCAL_FOLDER/SourceGit.icns
Type=Application
Terminal=false

View file

@ -0,0 +1,8 @@
[Desktop Entry]
Name=Source Git
Comment=Open-source & Free Git GUI Client
Exec=/opt/sourcegit/sourcegit
Icon=/usr/share/icons/sourcegit.png
Terminal=false
Type=Application
Categories=Development

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View file

@ -9,7 +9,7 @@
<key>CFBundleName</key> <key>CFBundleName</key>
<string>SourceGit</string> <string>SourceGit</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>8.8.0</string> <string>SOURCE_GIT_VERSION.0</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>
<string>10.12</string> <string>10.12</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
@ -19,7 +19,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>8.8</string> <string>SOURCE_GIT_VERSION</string>
<key>NSHighResolutionCapable</key> <key>NSHighResolutionCapable</key>
<true/> <true/>
</dict> </dict>

View file

@ -0,0 +1,7 @@
Package: sourcegit
Version: 8.8
Priority: optional
Depends: libx11-6, libice6, libsm6
Architecture: amd64
Maintainer: longshuang@msn.cn
Description: Open-source & Free Git GUI Client

View file

@ -0,0 +1,31 @@
Name: sourcegit
Version: %_version
Release: 1
Summary: Open-source & Free Git Gui Client
License: MIT
URL: https://sourcegit-scm.github.io/
Source: https://github.com/sourcegit-scm/sourcegit/archive/refs/tags/v%_version.tar.gz
Requires: libX11.so.6
Requires: libSM.so.6
%define _build_id_links none
%description
Open-source & Free Git Gui Client
%install
mkdir -p $RPM_BUILD_ROOT/opt/sourcegit
mkdir -p $RPM_BUILD_ROOT/usr/bin
mkdir -p $RPM_BUILD_ROOT/usr/share/applications
mkdir -p $RPM_BUILD_ROOT/usr/share/icons
cp -r ../../_common/usr $RPM_BUILD_ROOT/
cp -f ../../../SourceGit/* $RPM_BUILD_ROOT/opt/sourcegit/
chmod 755 -R $RPM_BUILD_ROOT
%files
/opt
/usr/bin
/usr/share
%changelog
# skip

View file

@ -165,7 +165,7 @@ namespace SourceGit
{ {
// Fetch lastest release information. // Fetch lastest release information.
var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(2) }; var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(2) };
var data = await client.GetStringAsync("https://api.github.com/repos/sourcegit-scm/sourcegit/releases/latest"); var data = await client.GetStringAsync("https://sourcegit-scm.github.io/data/version.json");
// Parse json into Models.Version. // Parse json into Models.Version.
var ver = JsonSerializer.Deserialize(data, JsonCodeGen.Default.Version); var ver = JsonSerializer.Deserialize(data, JsonCodeGen.Default.Version);

View file

@ -7,7 +7,7 @@ namespace SourceGit.Commands
{ {
public static void All(string repo) public static void All(string repo)
{ {
new Reset(repo, "HEAD", "--hard").Exec(); new Restore(repo).Exec();
new Clean(repo).Exec(); new Clean(repo).Exec();
} }
@ -37,7 +37,7 @@ namespace SourceGit.Commands
for (int i = 0; i < needCheckout.Count; i += 10) for (int i = 0; i < needCheckout.Count; i += 10)
{ {
var count = Math.Min(10, needCheckout.Count - i); var count = Math.Min(10, needCheckout.Count - i);
new Checkout(repo).Files(needCheckout.GetRange(i, count)); new Restore(repo, needCheckout.GetRange(i, count), "--worktree --recurse-submodules").Exec();
} }
} }
@ -49,7 +49,7 @@ namespace SourceGit.Commands
var files = new List<string>(); var files = new List<string>();
for (int j = 0; j < count; j++) for (int j = 0; j < count; j++)
files.Add(changes[i + j].Path); files.Add(changes[i + j].Path);
new Restore(repo, files, "--staged --worktree").Exec(); new Restore(repo, files, "--staged --worktree --recurse-submodules").Exec();
} }
} }
} }

View file

@ -5,6 +5,13 @@ namespace SourceGit.Commands
{ {
public class Restore : Command public class Restore : Command
{ {
public Restore(string repo)
{
WorkingDirectory = repo;
Context = repo;
Args = "restore . --source=HEAD --staged --worktree --recurse-submodules";
}
public Restore(string repo, List<string> files, string extra) public Restore(string repo, List<string> files, string extra)
{ {
WorkingDirectory = repo; WorkingDirectory = repo;

View file

@ -5,10 +5,10 @@ namespace SourceGit.Converters
{ {
public static class BoolConverters public static class BoolConverters
{ {
public static readonly FuncValueConverter<bool, double> ToCommitOpacity = public static readonly FuncValueConverter<bool, double> HalfIfFalse =
new FuncValueConverter<bool, double>(x => x ? 1 : 0.5); new FuncValueConverter<bool, double>(x => x ? 1 : 0.5);
public static readonly FuncValueConverter<bool, FontWeight> ToCommitFontWeight = public static readonly FuncValueConverter<bool, FontWeight> BoldIfTrue =
new FuncValueConverter<bool, FontWeight>(x => x ? FontWeight.Bold : FontWeight.Regular); new FuncValueConverter<bool, FontWeight>(x => x ? FontWeight.Bold : FontWeight.Regular);
} }
} }

View file

@ -96,7 +96,7 @@ namespace SourceGit.Native
{ {
var dir = string.IsNullOrEmpty(workdir) ? "~" : workdir; var dir = string.IsNullOrEmpty(workdir) ? "~" : workdir;
if (_terminal == null) if (_terminal == null)
App.RaiseException(dir, $"Only supports gnome-terminal/konsole/xfce4-terminal/deepin-terminal!"); App.RaiseException(dir, $"Only supports gnome-terminal/konsole/xfce4-terminal/lxterminal/deepin-terminal!");
else else
_terminal.Open(dir); _terminal.Open(dir);
} }
@ -158,6 +158,12 @@ namespace SourceGit.Native
return new Terminal(test, "--working-directory=\"{0}\""); return new Terminal(test, "--working-directory=\"{0}\"");
} }
test = Path.Combine(path, "lxterminal");
if (File.Exists(test))
{
return new Terminal(test, "--working-directory=\"{0}\"");
}
test = Path.Combine(path, "deepin-terminal"); test = Path.Combine(path, "deepin-terminal");
if (File.Exists(test)) if (File.Exists(test))
{ {

View file

@ -23,9 +23,8 @@ namespace SourceGit.Native
public string FindGitExecutable() public string FindGitExecutable()
{ {
if (File.Exists("/usr/bin/git")) // XCode built-in git
return "/usr/bin/git"; return File.Exists("/usr/bin/git") ? "/usr/bin/git" : string.Empty;
return string.Empty;
} }
public List<Models.ExternalTool> FindExternalTools() public List<Models.ExternalTool> FindExternalTools()
@ -34,7 +33,7 @@ namespace SourceGit.Native
finder.VSCode(() => "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"); finder.VSCode(() => "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code");
finder.VSCodeInsiders(() => "/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code"); finder.VSCodeInsiders(() => "/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code");
finder.Fleet(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}/Applications/Fleet.app/Contents/MacOS/Fleet"); finder.Fleet(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}/Applications/Fleet.app/Contents/MacOS/Fleet");
finder.SublimeText(() => "/Applications/Sublime Text.app/Contents/SharedSupport/bin"); finder.SublimeText(() => "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl");
return finder.Founded; return finder.Founded;
} }
@ -69,7 +68,7 @@ namespace SourceGit.Native
var tmp = Path.GetTempFileName(); var tmp = Path.GetTempFileName();
File.WriteAllText(tmp, builder.ToString()); File.WriteAllText(tmp, builder.ToString());
var proc = Process.Start("/usr/bin/osascript", $"\"{tmp}\""); var proc = Process.Start("osascript", $"\"{tmp}\"");
proc.Exited += (o, e) => File.Delete(tmp); proc.Exited += (o, e) => File.Delete(tmp);
} }

View file

@ -61,7 +61,7 @@ namespace SourceGit.Native
{ {
if (OperatingSystem.IsWindows()) if (OperatingSystem.IsWindows())
{ {
var windows = (_backend as Windows); var windows = _backend as Windows;
if (windows.Shell != shell) if (windows.Shell != shell)
{ {
windows.Shell = shell; windows.Shell = shell;

View file

@ -160,7 +160,7 @@ namespace SourceGit.Native
return; return;
} }
startInfo.FileName = FindWindowsTerminalApp(); startInfo.FileName = wt;
startInfo.Arguments = $"-d \"{workdir}\""; startInfo.Arguments = $"-d \"{workdir}\"";
break; break;
default: default:

View file

@ -54,13 +54,14 @@
<StreamGeometry x:Key="Icons.Blame">M128 256h192a64 64 0 110 128H128a64 64 0 110-128zm576 192h192a64 64 0 010 128h-192a64 64 0 010-128zm-576 192h192a64 64 0 010 128H128a64 64 0 010-128zm576 0h192a64 64 0 010 128h-192a64 64 0 010-128zm0-384h192a64 64 0 010 128h-192a64 64 0 010-128zM128 448h192a64 64 0 110 128H128a64 64 0 110-128zm384-320a64 64 0 0164 64v640a64 64 0 01-128 0V192a64 64 0 0164-64z</StreamGeometry> <StreamGeometry x:Key="Icons.Blame">M128 256h192a64 64 0 110 128H128a64 64 0 110-128zm576 192h192a64 64 0 010 128h-192a64 64 0 010-128zm-576 192h192a64 64 0 010 128H128a64 64 0 010-128zm576 0h192a64 64 0 010 128h-192a64 64 0 010-128zm0-384h192a64 64 0 010 128h-192a64 64 0 010-128zM128 448h192a64 64 0 110 128H128a64 64 0 110-128zm384-320a64 64 0 0164 64v640a64 64 0 01-128 0V192a64 64 0 0164-64z</StreamGeometry>
<StreamGeometry x:Key="Icons.Histories">M24 512A488 488 0 01512 24A488 488 0 011000 512A488 488 0 01512 1000A488 488 0 0124 512zm447-325v327L243 619l51 111 300-138V187H471z</StreamGeometry> <StreamGeometry x:Key="Icons.Histories">M24 512A488 488 0 01512 24A488 488 0 011000 512A488 488 0 01512 1000A488 488 0 0124 512zm447-325v327L243 619l51 111 300-138V187H471z</StreamGeometry>
<StreamGeometry x:Key="Icons.Archive">M715 254h-405l-58 57h520zm-492 86v201h578V340zm405 143h-29v-29H425v29h-29v-57h231v57zm-405 295h578V559H223zm174-133h231v57h-29v-29H425v29h-29v-57z</StreamGeometry> <StreamGeometry x:Key="Icons.Archive">M715 254h-405l-58 57h520zm-492 86v201h578V340zm405 143h-29v-29H425v29h-29v-57h231v57zm-405 295h578V559H223zm174-133h231v57h-29v-29H425v29h-29v-57z</StreamGeometry>
<StreamGeometry x:Key="Icons.Branch">M869 145a145 145 0 10-289 0c0 56 33 107 83 131c-5 96-77 128-201 175c-52 20-110 42-160 74V276A144 144 0 00242 0a145 145 0 00-145 145c0 58 35 108 84 131v461a144 144 0 00-84 131a145 145 0 10289 0a144 144 0 00-84-131c5-95 77-128 201-175c122-46 274-103 280-287a145 145 0 0085-132zM242 61a83 83 0 110 167a83 83 0 010-167zm0 891a84 84 0 110-167a84 84 0 010 167zM724 228a84 84 0 110-167a84 84 0 010 167z</StreamGeometry> <StreamGeometry x:Key="Icons.Branch">M757 226a143 143 0 00-55 276 96 96 0 01-88 59h-191a187 187 0 00-96 27V312a143 143 0 10-96 0v399a143 143 0 10103 2 96 96 0 0188-59h191a191 191 0 00187-151 143 143 0 00-43-279zM280 130a48 48 0 110 96 48 48 0 010-96zm0 764a48 48 0 110-96 48 48 0 010 96zM757 417a48 48 0 110-96 48 48 0 010 96z</StreamGeometry>
<StreamGeometry x:Key="Icons.Branch.Add">M896 128h-64V64c0-35-29-64-64-64s-64 29-64 64v64h-64c-35 0-64 29-64 64s29 64 64 64h64v64c0 35 29 64 64 64s64-29 64-64V256h64c35 0 64-29 64-64s-29-64-64-64zm-204 307C673 481 628 512 576 512H448c-47 0-90 13-128 35V372C394 346 448 275 448 192c0-106-86-192-192-192S64 86 64 192c0 83 54 154 128 180v280c-74 26-128 97-128 180c0 106 86 192 192 192s192-86 192-192c0-67-34-125-84-159c22-20 52-33 84-33h128c122 0 223-85 249-199c-19 4-37 7-57 7c-26 0-51-5-76-13zM256 128c35 0 64 29 64 64s-29 64-64 64s-64-29-64-64s29-64 64-64zm0 768c-35 0-64-29-64-64s29-64 64-64s64 29 64 64s-29 64-64 64z</StreamGeometry> <StreamGeometry x:Key="Icons.Branch.Add">M896 128h-64V64c0-35-29-64-64-64s-64 29-64 64v64h-64c-35 0-64 29-64 64s29 64 64 64h64v64c0 35 29 64 64 64s64-29 64-64V256h64c35 0 64-29 64-64s-29-64-64-64zm-204 307C673 481 628 512 576 512H448c-47 0-90 13-128 35V372C394 346 448 275 448 192c0-106-86-192-192-192S64 86 64 192c0 83 54 154 128 180v280c-74 26-128 97-128 180c0 106 86 192 192 192s192-86 192-192c0-67-34-125-84-159c22-20 52-33 84-33h128c122 0 223-85 249-199c-19 4-37 7-57 7c-26 0-51-5-76-13zM256 128c35 0 64 29 64 64s-29 64-64 64s-64-29-64-64s29-64 64-64zm0 768c-35 0-64-29-64-64s29-64 64-64s64 29 64 64s-29 64-64 64z</StreamGeometry>
<StreamGeometry x:Key="Icons.Remote">M902 479v-1c0-133-112-242-250-242c-106 0-196 64-232 154c-28-20-62-32-100-32c-76 0-140 49-160 116c-52 37-86 97-86 165c0 112 90 202 202 202h503c112 0 202-90 202-202c0-65-31-123-79-160z</StreamGeometry> <StreamGeometry x:Key="Icons.Remote">M706 302a289 289 0 00-173 44 27 27 0 1029 46 234 234 0 01125-36c23 0 45 3 66 9 93 28 161 114 161 215C914 704 813 805 687 805H337C211 805 110 704 110 580c0-96 61-178 147-210C282 263 379 183 495 183a245 245 0 01210 119z</StreamGeometry>
<StreamGeometry x:Key="Icons.Remote.Add">M364 512h67v108h108v67h-108v108h-67v-108h-108v-67h108v-108zm298-64A107 107 0 01768 555C768 614 720 660 660 660h-108v-54h-108v-108h-94v108h-94c4-21 22-47 44-51l-1-12a75 75 0 0171-75a128 128 0 01239-7a106 106 0 0153-14z</StreamGeometry> <StreamGeometry x:Key="Icons.Remote.Add">M364 512h67v108h108v67h-108v108h-67v-108h-108v-67h108v-108zm298-64A107 107 0 01768 555C768 614 720 660 660 660h-108v-54h-108v-108h-94v108h-94c4-21 22-47 44-51l-1-12a75 75 0 0171-75a128 128 0 01239-7a106 106 0 0153-14z</StreamGeometry>
<StreamGeometry x:Key="Icons.Tag">M177 156c-22 5-33 17-36 37c-10 57-33 258-13 278l445 445c23 23 61 23 84 0l246-246c23-23 23-61 0-84l-445-445C437 120 231 145 177 156zM331 344c-26 26-69 26-95 0c-26-26-26-69 0-95s69-26 95 0C357 276 357 318 331 344z</StreamGeometry> <StreamGeometry x:Key="Icons.Tag">M177 156c-22 5-33 17-36 37c-10 57-33 258-13 278l445 445c23 23 61 23 84 0l246-246c23-23 23-61 0-84l-445-445C437 120 231 145 177 156zM331 344c-26 26-69 26-95 0c-26-26-26-69 0-95s69-26 95 0C357 276 357 318 331 344z</StreamGeometry>
<StreamGeometry x:Key="Icons.Tag.Add">M683 537h-144v-142h-142V283H239a44 44 0 00-41 41v171a56 56 0 0014 34l321 321a41 41 0 0058 0l174-174a41 41 0 000-58zm-341-109a41 41 0 110-58a41 41 0 010 58zM649 284V142h-69v142h-142v68h142v142h69v-142h142v-68h-142z</StreamGeometry> <StreamGeometry x:Key="Icons.Tag.Add">M683 537h-144v-142h-142V283H239a44 44 0 00-41 41v171a56 56 0 0014 34l321 321a41 41 0 0058 0l174-174a41 41 0 000-58zm-341-109a41 41 0 110-58a41 41 0 010 58zM649 284V142h-69v142h-142v68h142v142h69v-142h142v-68h-142z</StreamGeometry>
<StreamGeometry x:Key="Icons.Submodule">M557.7 545.3 789.9 402.7c24-15 31.3-46.5 16.4-70.5c-14.8-23.8-46-31.2-70-16.7L506.5 456.6 277.1 315.4c-24.1-14.8-55.6-7.3-70.5 16.8c-14.8 24.1-7.3 55.6 16.8 70.5l231.8 142.6V819.1c0 28.3 22.9 51.2 51.2 51.2c28.3 0 51.2-22.9 51.2-51.2V545.3h.1zM506.5 0l443.4 256v511.9L506.5 1023.9 63.1 767.9v-511.9L506.5 0z</StreamGeometry> <StreamGeometry x:Key="Icons.Submodule">M557.7 545.3 789.9 402.7c24-15 31.3-46.5 16.4-70.5c-14.8-23.8-46-31.2-70-16.7L506.5 456.6 277.1 315.4c-24.1-14.8-55.6-7.3-70.5 16.8c-14.8 24.1-7.3 55.6 16.8 70.5l231.8 142.6V819.1c0 28.3 22.9 51.2 51.2 51.2c28.3 0 51.2-22.9 51.2-51.2V545.3h.1zM506.5 0l443.4 256v511.9L506.5 1023.9 63.1 767.9v-511.9L506.5 0z</StreamGeometry>
<StreamGeometry x:Key="Icons.Submodule.Add">M770 320a41 41 0 00-56-14l-252 153L207 306a41 41 0 10-43 70l255 153 2 296a41 41 0 0082 0l-2-295 255-155a41 41 0 0014-56zM481 935a42 42 0 01-42 0L105 741a42 42 0 01-21-36v-386a42 42 0 0121-36L439 89a42 42 0 0142 0l335 193a42 42 0 0121 36v87h84v-87a126 126 0 00-63-109L523 17a126 126 0 00-126 0L63 210a126 126 0 00-63 109v386a126 126 0 0063 109l335 193a126 126 0 00126 0l94-54-42-72zM1029 700h-126v-125a42 42 0 00-84 0v126h-126a42 42 0 000 84h126v126a42 42 0 1084 0v-126h126a42 42 0 000-84z</StreamGeometry>
<StreamGeometry x:Key="Icons.LFS">M170 470l0 84 86 0 0-84-86 0zM86 598l0-172 852 0 0 172-852 0zM256 298l0-84-86 0 0 84 86 0zM86 170l852 0 0 172-852 0 0-172zM170 726l0 84 86 0 0-84-86 0zM86 854l0-172 852 0 0 172-852 0z</StreamGeometry> <StreamGeometry x:Key="Icons.LFS">M170 470l0 84 86 0 0-84-86 0zM86 598l0-172 852 0 0 172-852 0zM256 298l0-84-86 0 0 84 86 0zM86 170l852 0 0 172-852 0 0-172zM170 726l0 84 86 0 0-84-86 0zM86 854l0-172 852 0 0 172-852 0z</StreamGeometry>
<StreamGeometry x:Key="Icons.Waiting">M812 864h-29V654c0-21-11-40-28-52l-133-88 134-89c18-12 28-31 28-52V164h28c18 0 32-14 32-32s-14-32-32-32H212c-18 0-32 14-32 32s14 32 32 32h30v210c0 21 11 40 28 52l133 88-134 89c-18 12-28 31-28 52V864H212c-18 0-32 14-32 32s14 32 32 32h600c18 0 32-14 32-32s-14-32-32-32zM441 566c18-12 28-31 28-52s-11-40-28-52L306 373V164h414v209l-136 90c-18 12-28 31-28 52 0 21 11 40 28 52l135 89V695c-9-7-20-13-32-19-30-15-93-41-176-41-63 0-125 14-175 38-12 6-22 12-31 18v-36l136-90z</StreamGeometry> <StreamGeometry x:Key="Icons.Waiting">M812 864h-29V654c0-21-11-40-28-52l-133-88 134-89c18-12 28-31 28-52V164h28c18 0 32-14 32-32s-14-32-32-32H212c-18 0-32 14-32 32s14 32 32 32h30v210c0 21 11 40 28 52l133 88-134 89c-18 12-28 31-28 52V864H212c-18 0-32 14-32 32s14 32 32 32h600c18 0 32-14 32-32s-14-32-32-32zM441 566c18-12 28-31 28-52s-11-40-28-52L306 373V164h414v209l-136 90c-18 12-28 31-28 52 0 21 11 40 28 52l135 89V695c-9-7-20-13-32-19-30-15-93-41-176-41-63 0-125 14-175 38-12 6-22 12-31 18v-36l136-90z</StreamGeometry>
<StreamGeometry x:Key="Icons.Loading">M512 0C233 0 7 223 0 500C6 258 190 64 416 64c230 0 416 200 416 448c0 53 43 96 96 96s96-43 96-96c0-283-229-512-512-512zm0 1023c279 0 505-223 512-500c-6 242-190 436-416 436c-230 0-416-200-416-448c0-53-43-96-96-96s-96 43-96 96c0 283 229 512 512 512z</StreamGeometry> <StreamGeometry x:Key="Icons.Loading">M512 0C233 0 7 223 0 500C6 258 190 64 416 64c230 0 416 200 416 448c0 53 43 96 96 96s96-43 96-96c0-283-229-512-512-512zm0 1023c279 0 505-223 512-500c-6 242-190 436-416 436c-230 0-416-200-416-448c0-53-43-96-96-96s-96 43-96 96c0 283 229 512 512 512z</StreamGeometry>
@ -87,7 +88,11 @@
<StreamGeometry x:Key="Icons.LayoutVertical">M875 117H149C109 117 75 151 75 192v640c0 41 34 75 75 75h725c41 0 75-34 75-75V192c0-41-34-75-75-75zm-725 64h725c6 0 11 4 11 11v288h-747V192c0-6 4-11 11-11zm725 661H149c-6 0-11-4-11-11V544h747V832c0 6-4 11-11 11z</StreamGeometry> <StreamGeometry x:Key="Icons.LayoutVertical">M875 117H149C109 117 75 151 75 192v640c0 41 34 75 75 75h725c41 0 75-34 75-75V192c0-41-34-75-75-75zm-725 64h725c6 0 11 4 11 11v288h-747V192c0-6 4-11 11-11zm725 661H149c-6 0-11-4-11-11V544h747V832c0 6-4 11-11 11z</StreamGeometry>
<StreamGeometry x:Key="Icons.SyntaxHighlight">M875 128h-725A107 107 0 0043 235v555A107 107 0 00149 896h725a107 107 0 00107-107v-555A107 107 0 00875 128zm-115 640h-183v-58l25-3c15 0 19-8 14-24l-22-61H419l-28 82 39 2V768h-166v-58l18-3c18-2 22-11 26-24l125-363-40-4V256h168l160 448 39 3zM506 340l-72 218h145l-71-218h-2z</StreamGeometry> <StreamGeometry x:Key="Icons.SyntaxHighlight">M875 128h-725A107 107 0 0043 235v555A107 107 0 00149 896h725a107 107 0 00107-107v-555A107 107 0 00875 128zm-115 640h-183v-58l25-3c15 0 19-8 14-24l-22-61H419l-28 82 39 2V768h-166v-58l18-3c18-2 22-11 26-24l125-363-40-4V256h168l160 448 39 3zM506 340l-72 218h145l-71-218h-2z</StreamGeometry>
<StreamGeometry x:Key="Icons.SoftwareUpdate">M900 287c40 69 60 144 60 225s-20 156-60 225c-40 69-94 123-163 163-69 40-144 60-225 60s-156-20-225-60c-69-40-123-94-163-163C84 668 64 593 64 512s20-156 60-225 94-123 163-163c69-40 144-60 225-60s156 20 225 60 123 94 163 163zM762 512c0-9-3-16-9-22L578 315l-44-44c-6-6-13-9-22-9s-16 3-22 9l-44 44-176 176c-6 6-9 13-9 22s3 16 9 22l44 44c6 6 13 9 22 9s16-3 22-9l92-92v269c0 9 3 16 9 22 6 6 13 9 22 9h62c8 0 16-3 22-9 6-6 9-13 9-22V486l92 92c6 6 13 9 22 9 8 0 16-3 22-9l44-44c6-6 9-13 9-22z</StreamGeometry> <StreamGeometry x:Key="Icons.SoftwareUpdate">M900 287c40 69 60 144 60 225s-20 156-60 225c-40 69-94 123-163 163-69 40-144 60-225 60s-156-20-225-60c-69-40-123-94-163-163C84 668 64 593 64 512s20-156 60-225 94-123 163-163c69-40 144-60 225-60s156 20 225 60 123 94 163 163zM762 512c0-9-3-16-9-22L578 315l-44-44c-6-6-13-9-22-9s-16 3-22 9l-44 44-176 176c-6 6-9 13-9 22s3 16 9 22l44 44c6 6 13 9 22 9s16-3 22-9l92-92v269c0 9 3 16 9 22 6 6 13 9 22 9h62c8 0 16-3 22-9 6-6 9-13 9-22V486l92 92c6 6 13 9 22 9 8 0 16-3 22-9l44-44c6-6 9-13 9-22z</StreamGeometry>
<StreamGeometry x:Key="Icons.Target">M765 555C747 661 661 747 555 765L555 683 469 683 469 765C363 747 277 661 259 555L341 555 341 469 259 469C277 363 363 277 469 259L469 341 555 341 555 259C661 277 747 363 765 469L683 469 683 555 765 555M851 469C832 315 709 192 555 173L555 85 469 85 469 173C315 192 192 315 173 469L85 469 85 555 173 555C192 709 315 832 469 851L469 939 555 939 555 851C709 832 832 709 851 555L939 555 939 469 851 469M512 427C559 427 597 465 597 512 597 559 559 597 512 597 465 597 427 559 427 512 427 465 465 427 512 427L512 427Z</StreamGeometry> <StreamGeometry x:Key="Icons.Target">M765 118 629 239l-16 137-186 160 54 59 183-168 144 4 136-129 47-43-175-12L827 67zM489 404c-66 0-124 55-124 125s54 121 124 121c66 0 120-55 120-121H489l23-121c-8-4-16-4-23-4zM695 525c0 114-93 207-206 207s-206-94-206-207 93-207 206-207c16 0 27 0 43 4l43-207c-27-4-54-8-85-8-229 0-416 188-416 419s187 419 416 419c225 0 408-180 416-403v-12l-210-4z</StreamGeometry>
<StreamGeometry x:Key="Icons.Incoming">M973 358a51 51 0 0151 51v563a51 51 0 01-51 51H51a51 51 0 01-51-51V410a51 51 0 0151-51h256a51 51 0 110 102H102v461h819V461h-205a51 51 0 110-102h256zM51 102a51 51 0 110-102h256c141 0 256 115 256 256v388l66-66a51 51 0 1172 72l-154 154a51 51 0 01-72 0l-154-154a51 51 0 1172-72L461 644V256c0-85-69-154-154-154H51z</StreamGeometry> <StreamGeometry x:Key="Icons.Incoming">M973 358a51 51 0 0151 51v563a51 51 0 01-51 51H51a51 51 0 01-51-51V410a51 51 0 0151-51h256a51 51 0 110 102H102v461h819V461h-205a51 51 0 110-102h256zM51 102a51 51 0 110-102h256c141 0 256 115 256 256v388l66-66a51 51 0 1172 72l-154 154a51 51 0 01-72 0l-154-154a51 51 0 1172-72L461 644V256c0-85-69-154-154-154H51z</StreamGeometry>
<StreamGeometry x:Key="Icons.Local">M976 0h-928A48 48 0 000 48v652a48 48 0 0048 48h416V928H200a48 48 0 000 96h624a48 48 0 000-96H560v-180h416a48 48 0 0048-48V48A48 48 0 00976 0zM928 652H96V96h832v556z</StreamGeometry> <StreamGeometry x:Key="Icons.Local">M976 0h-928A48 48 0 000 48v652a48 48 0 0048 48h416V928H200a48 48 0 000 96h624a48 48 0 000-96H560v-180h416a48 48 0 0048-48V48A48 48 0 00976 0zM928 652H96V96h832v556z</StreamGeometry>
<StreamGeometry x:Key="Icons.GitFlow.Init">M412 66C326 132 271 233 271 347c0 17 1 34 4 50-41-48-98-79-162-83a444 444 0 00-46 196c0 207 142 382 337 439h2c19 0 34 15 34 33 0 11-6 21-14 26l1 14C183 973 0 763 0 511 0 272 166 70 393 7A35 35 0 01414 0c19 0 34 15 34 33a33 33 0 01-36 33zm200 893c86-66 141-168 141-282 0-17-1-34-4-50 41 48 98 79 162 83a444 444 0 0046-196c0-207-142-382-337-439h-2a33 33 0 01-34-33c0-11 6-21 14-26L596 0C841 51 1024 261 1024 513c0 239-166 441-393 504A35 35 0 01610 1024a33 33 0 01-34-33 33 33 0 0136-33zM512 704a192 192 0 110-384 192 192 0 010 384z</StreamGeometry>
<StreamGeometry x:Key="Icons.GitFlow.Feature">M939 94v710L512 998 85 805V94h-64A21 21 0 010 73v-0C0 61 10 51 21 51h981c12 0 21 10 21 21v0c0 12-10 21-21 21h-64zm-536 588L512 624l109 58c6 3 13 4 20 3a32 32 0 0026-37l-21-122 88-87c5-5 8-11 9-18a32 32 0 00-27-37l-122-18-54-111a32 32 0 00-57 0l-54 111-122 18c-7 1-13 4-18 9a33 33 0 001 46l88 87-21 122c-1 7-0 14 3 20a32 32 0 0043 14z</StreamGeometry>
<StreamGeometry x:Key="Icons.GitFlow.Hotfix">M236 542a32 32 0 109 63l86-12a180 180 0 0022 78l-71 47a32 32 0 1035 53l75-50a176 176 0 00166 40L326 529zM512 16C238 16 16 238 16 512s222 496 496 496 496-222 496-496S786 16 512 16zm0 896c-221 0-400-179-400-400a398 398 0 0186-247l561 561A398 398 0 01512 912zm314-154L690 622a179 179 0 004-29l85 12a32 32 0 109-63l-94-13v-49l94-13a32 32 0 10-9-63l-87 12a180 180 0 00-20-62l71-47A32 32 0 10708 252l-75 50a181 181 0 00-252 10l-115-115A398 398 0 01512 112c221 0 400 179 400 400a398 398 0 01-86 247z</StreamGeometry>
<StreamGeometry x:Key="Icons.GitFlow.Release">M884 159l-18-18a43 43 0 00-38-12l-235 43a166 166 0 00-101 60L400 349a128 128 0 00-148 47l-120 171a21 21 0 005 29l17 12a128 128 0 00178-32l27-38 124 124-38 27a128 128 0 00-32 178l12 17a21 21 0 0029 5l171-120a128 128 0 0047-148l117-92A166 166 0 00853 431l43-235a43 43 0 00-12-38zm-177 249a64 64 0 110-90 64 64 0 010 90zm-373 312a21 21 0 010 30l-139 139a21 21 0 01-30 0l-30-30a21 21 0 010-30l139-139a21 21 0 0130 0z</StreamGeometry>
</ResourceDictionary> </ResourceDictionary>

View file

@ -252,9 +252,9 @@
<x:String x:Key="Text.Paste" xml:space="preserve">Paste</x:String> <x:String x:Key="Text.Paste" xml:space="preserve">Paste</x:String>
<x:String x:Key="Text.Preference" xml:space="preserve">Preference</x:String> <x:String x:Key="Text.Preference" xml:space="preserve">Preference</x:String>
<x:String x:Key="Text.Preference.Appearance" xml:space="preserve">APPEARANCE</x:String> <x:String x:Key="Text.Preference.Appearance" xml:space="preserve">APPEARANCE</x:String>
<x:String x:Key="Text.Preference.Appearance.DefaultFont" xml:space="preserve">Default FontFamily</x:String> <x:String x:Key="Text.Preference.Appearance.DefaultFont" xml:space="preserve">Default Font</x:String>
<x:String x:Key="Text.Preference.Appearance.DefaultFontSize" xml:space="preserve">Default Font Size</x:String> <x:String x:Key="Text.Preference.Appearance.DefaultFontSize" xml:space="preserve">Default Font Size</x:String>
<x:String x:Key="Text.Preference.Appearance.MonospaceFont" xml:space="preserve">Monospace FontFamily</x:String> <x:String x:Key="Text.Preference.Appearance.MonospaceFont" xml:space="preserve">Monospace Font</x:String>
<x:String x:Key="Text.Preference.Appearance.Theme" xml:space="preserve">Theme</x:String> <x:String x:Key="Text.Preference.Appearance.Theme" xml:space="preserve">Theme</x:String>
<x:String x:Key="Text.Preference.General" xml:space="preserve">GENERAL</x:String> <x:String x:Key="Text.Preference.General" xml:space="preserve">GENERAL</x:String>
<x:String x:Key="Text.Preference.General.AvatarServer" xml:space="preserve">Avatar Server</x:String> <x:String x:Key="Text.Preference.General.AvatarServer" xml:space="preserve">Avatar Server</x:String>

View file

@ -5,7 +5,7 @@
<BuiltInComInteropSupport>true</BuiltInComInteropSupport> <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>App.manifest</ApplicationManifest> <ApplicationManifest>App.manifest</ApplicationManifest>
<ApplicationIcon>App.ico</ApplicationIcon> <ApplicationIcon>App.ico</ApplicationIcon>
<Version>8.8</Version> <Version>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)\\..\\VERSION"))</Version>
<BuiltInComInteropSupport>false</BuiltInComInteropSupport> <BuiltInComInteropSupport>false</BuiltInComInteropSupport>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault> <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings> <SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>

View file

@ -715,6 +715,7 @@ namespace SourceGit.ViewModels
{ {
var startFeature = new MenuItem(); var startFeature = new MenuItem();
startFeature.Header = App.Text("GitFlow.StartFeature"); startFeature.Header = App.Text("GitFlow.StartFeature");
startFeature.Icon = App.CreateMenuIcon("Icons.GitFlow.Feature");
startFeature.Click += (o, e) => startFeature.Click += (o, e) =>
{ {
if (PopupHost.CanCreatePopup()) if (PopupHost.CanCreatePopup())
@ -724,6 +725,7 @@ namespace SourceGit.ViewModels
var startRelease = new MenuItem(); var startRelease = new MenuItem();
startRelease.Header = App.Text("GitFlow.StartRelease"); startRelease.Header = App.Text("GitFlow.StartRelease");
startRelease.Icon = App.CreateMenuIcon("Icons.GitFlow.Release");
startRelease.Click += (o, e) => startRelease.Click += (o, e) =>
{ {
if (PopupHost.CanCreatePopup()) if (PopupHost.CanCreatePopup())
@ -733,6 +735,7 @@ namespace SourceGit.ViewModels
var startHotfix = new MenuItem(); var startHotfix = new MenuItem();
startHotfix.Header = App.Text("GitFlow.StartHotfix"); startHotfix.Header = App.Text("GitFlow.StartHotfix");
startHotfix.Icon = App.CreateMenuIcon("Icons.GitFlow.Hotfix");
startHotfix.Click += (o, e) => startHotfix.Click += (o, e) =>
{ {
if (PopupHost.CanCreatePopup()) if (PopupHost.CanCreatePopup())
@ -748,6 +751,7 @@ namespace SourceGit.ViewModels
{ {
var init = new MenuItem(); var init = new MenuItem();
init.Header = App.Text("GitFlow.Init"); init.Header = App.Text("GitFlow.Init");
init.Icon = App.CreateMenuIcon("Icons.GitFlow.Init");
init.Click += (o, e) => init.Click += (o, e) =>
{ {
if (PopupHost.CanCreatePopup()) if (PopupHost.CanCreatePopup())

View file

@ -1,4 +1,5 @@
using Avalonia; using Avalonia;
using Avalonia.Controls;
using Avalonia.Input; using Avalonia.Input;
namespace SourceGit.Views namespace SourceGit.Views
@ -6,17 +7,11 @@ namespace SourceGit.Views
public class AutoFocusBehaviour : AvaloniaObject public class AutoFocusBehaviour : AvaloniaObject
{ {
public static readonly AttachedProperty<bool> IsEnabledProperty = public static readonly AttachedProperty<bool> IsEnabledProperty =
AvaloniaProperty.RegisterAttached<AutoFocusBehaviour, InputElement, bool>("IsEnabled", false, false); AvaloniaProperty.RegisterAttached<AutoFocusBehaviour, TextBox, bool>("IsEnabled", false, false);
static AutoFocusBehaviour() static AutoFocusBehaviour()
{ {
IsEnabledProperty.Changed.AddClassHandler<InputElement>((input, e) => IsEnabledProperty.Changed.AddClassHandler<TextBox>(OnIsEnabledChanged);
{
if (input.GetValue(IsEnabledProperty))
{
input.AttachedToVisualTree += (o, _) => (o as InputElement).Focus(NavigationMethod.Directional);
}
});
} }
public static bool GetIsEnabled(AvaloniaObject elem) public static bool GetIsEnabled(AvaloniaObject elem)
@ -28,5 +23,18 @@ namespace SourceGit.Views
{ {
elem.SetValue(IsEnabledProperty, value); elem.SetValue(IsEnabledProperty, value);
} }
private static void OnIsEnabledChanged(TextBox elem, AvaloniaPropertyChangedEventArgs e)
{
if (GetIsEnabled(elem))
{
elem.AttachedToVisualTree += (o, _) =>
{
var text = o as TextBox;
text.Focus(NavigationMethod.Directional);
text.CaretIndex = text.Text == null ? 0 : text.Text.Length;
};
}
}
} }
} }

View file

@ -86,7 +86,7 @@
<Border Height="16" Margin="0,0,6,0" CornerRadius="2" ClipToBounds="True"> <Border Height="16" Margin="0,0,6,0" CornerRadius="2" ClipToBounds="True">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Border Background="{DynamicResource Brush.Decorator}" Width="16"> <Border Background="{DynamicResource Brush.Decorator}" Width="16">
<Path Width="8" Height="8" Stretch="Fill" Data="{Binding Type, Converter={x:Static c:DecoratorTypeConverters.ToIcon}}" Fill="{DynamicResource Brush.DecoratorIcon}"/> <Path Width="8" Height="8" Data="{Binding Type, Converter={x:Static c:DecoratorTypeConverters.ToIcon}}" Fill="{DynamicResource Brush.DecoratorIcon}"/>
</Border> </Border>
<Border Background="{Binding Type, Converter={x:Static c:DecoratorTypeConverters.ToBackground}}"> <Border Background="{Binding Type, Converter={x:Static c:DecoratorTypeConverters.ToBackground}}">
<TextBlock Classes="monospace" Text="{Binding Name}" FontSize="10" Margin="4,0" Foreground="Black"/> <TextBlock Classes="monospace" Text="{Binding Name}" FontSize="10" Margin="4,0" Foreground="Black"/>

View file

@ -69,8 +69,8 @@
<TextBlock Classes="monospace" <TextBlock Classes="monospace"
Text="{Binding Subject}" Text="{Binding Subject}"
Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}" Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.HalfIfFalse}}"
FontWeight="{Binding IsCurrentHead, Converter={x:Static c:BoolConverters.ToCommitFontWeight}}"/> FontWeight="{Binding IsCurrentHead, Converter={x:Static c:BoolConverters.BoldIfTrue}}"/>
</StackPanel> </StackPanel>
</Border> </Border>
</DataTemplate> </DataTemplate>
@ -85,7 +85,7 @@
VerticalAlignment="Center" VerticalAlignment="Center"
IsHitTestVisible="False" IsHitTestVisible="False"
User="{Binding Author}" User="{Binding Author}"
Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}"/> Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.HalfIfFalse}}"/>
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
@ -96,8 +96,8 @@
<TextBlock Classes="monospace" <TextBlock Classes="monospace"
Text="{Binding Author.Name}" Text="{Binding Author.Name}"
Margin="0,0,8,0" Margin="0,0,8,0"
Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}" Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.HalfIfFalse}}"
FontWeight="{Binding IsCurrentHead, Converter={x:Static c:BoolConverters.ToCommitFontWeight}}"/> FontWeight="{Binding IsCurrentHead, Converter={x:Static c:BoolConverters.BoldIfTrue}}"/>
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
@ -108,8 +108,8 @@
<TextBlock Classes="monospace" <TextBlock Classes="monospace"
Text="{Binding SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Text="{Binding SHA, Converter={x:Static c:StringConverters.ToShortSHA}}"
Margin="12,0" Margin="12,0"
Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}" Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.HalfIfFalse}}"
FontWeight="{Binding IsCurrentHead, Converter={x:Static c:BoolConverters.ToCommitFontWeight}}"/> FontWeight="{Binding IsCurrentHead, Converter={x:Static c:BoolConverters.BoldIfTrue}}"/>
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
@ -120,8 +120,8 @@
<TextBlock Classes="monospace" <TextBlock Classes="monospace"
Text="{Binding CommitterTimeStr}" Text="{Binding CommitterTimeStr}"
Margin="8,0" Margin="8,0"
Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}" Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.HalfIfFalse}}"
FontWeight="{Binding IsCurrentHead, Converter={x:Static c:BoolConverters.ToCommitFontWeight}}"/> FontWeight="{Binding IsCurrentHead, Converter={x:Static c:BoolConverters.BoldIfTrue}}"/>
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
@ -131,6 +131,7 @@
<v:CommitGraph x:Name="commitGraph" <v:CommitGraph x:Name="commitGraph"
BindingDataGrid="{Binding #commitDataGrid}" BindingDataGrid="{Binding #commitDataGrid}"
Graph="{Binding Graph}" Graph="{Binding Graph}"
DotBrush="{DynamicResource Brush.Contents}"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
IsHitTestVisible="False" IsHitTestVisible="False"
ClipToBounds="True"/> ClipToBounds="True"/>

View file

@ -99,19 +99,18 @@ namespace SourceGit.Views
set => SetValue(BindingDataGridProperty, value); set => SetValue(BindingDataGridProperty, value);
} }
public static readonly StyledProperty<IBrush> DotBrushProperty =
AvaloniaProperty.Register<CommitGraph, IBrush>(nameof(DotBrush), Brushes.Transparent);
public IBrush DotBrush
{
get => GetValue(DotBrushProperty);
set => SetValue(DotBrushProperty, value);
}
static CommitGraph() static CommitGraph()
{ {
AffectsRender<CommitGraph>(BindingDataGridProperty, GraphProperty); AffectsRender<CommitGraph>(BindingDataGridProperty, GraphProperty, DotBrushProperty);
}
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
{
base.OnPropertyChanged(change);
if (change.Property.Name == "ActualThemeVariant")
{
InvalidateVisual();
}
} }
public override void Render(DrawingContext context) public override void Render(DrawingContext context)
@ -153,11 +152,7 @@ namespace SourceGit.Views
DrawCurves(context, top, bottom); DrawCurves(context, top, bottom);
// Draw connect dots // Draw connect dots
Brush dotFill = null; IBrush dotFill = DotBrush;
if (App.Current.TryGetResource("Brush.Contents", App.Current.ActualThemeVariant, out object res) && res is SolidColorBrush)
{
dotFill = res as SolidColorBrush;
}
foreach (var dot in graph.Dots) foreach (var dot in graph.Dots)
{ {
if (dot.Center.Y < top) if (dot.Center.Y < top)

View file

@ -76,6 +76,10 @@
IsVisible="{Binding SelectedViewIndex, Converter={x:Static c:IntConverters.IsZero}}" IsVisible="{Binding SelectedViewIndex, Converter={x:Static c:IntConverters.IsZero}}"
ToolTip.Tip="{DynamicResource Text.Histories.DisplayMode}"/> ToolTip.Tip="{DynamicResource Text.Histories.DisplayMode}"/>
<Button Classes="icon_button" Width="32" Command="{Binding NavigateToCurrentHead}" ToolTip.Tip="{DynamicResource Text.Repository.NavigateToCurrentHead}">
<Path Width="14" Height="14" Data="{StaticResource Icons.Target}"/>
</Button>
<Button Classes="icon_button" Width="32" Command="{Binding Cleanup}" ToolTip.Tip="{DynamicResource Text.Repository.Clean}"> <Button Classes="icon_button" Width="32" Command="{Binding Cleanup}" ToolTip.Tip="{DynamicResource Text.Repository.Clean}">
<Path Width="14" Height="14" Data="{StaticResource Icons.Clean}"/> <Path Width="14" Height="14" Data="{StaticResource Icons.Clean}"/>
</Button> </Button>
@ -111,19 +115,16 @@
</ListBox.ItemsPanel> </ListBox.ItemsPanel>
<ListBoxItem Height="28" Padding="0"> <ListBoxItem Height="28" Padding="0">
<Grid Margin="16,0,0,0" Height="28" ColumnDefinitions="Auto,*,Auto"> <Grid Margin="16,0,0,0" Height="28" ColumnDefinitions="20,*">
<Path Grid.Column="0" Width="14" Height="14" Data="{StaticResource Icons.Histories}"/> <Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Data="{StaticResource Icons.Histories}"/>
<TextBlock Grid.Column="1" Margin="8,0,0,0" Classes="monospace" Text="{DynamicResource Text.Histories}"/> <TextBlock Grid.Column="1" Classes="monospace" Text="{DynamicResource Text.Histories}"/>
<Button Grid.Column="2" Classes="icon_button" Width="14" Margin="8,0" Command="{Binding NavigateToCurrentHead}" ToolTip.Tip="{DynamicResource Text.Repository.NavigateToCurrentHead}">
<Path Width="14" Height="14" Data="{StaticResource Icons.Target}"/>
</Button>
</Grid> </Grid>
</ListBoxItem> </ListBoxItem>
<ListBoxItem Height="28" Padding="0"> <ListBoxItem Height="28" Padding="0">
<Grid Margin="16,0,0,0" Height="28" ColumnDefinitions="Auto,*,Auto"> <Grid Margin="16,0,0,0" Height="28" ColumnDefinitions="20,*,Auto">
<Path Grid.Column="0" Width="14" Height="14" Data="{StaticResource Icons.Send}"/> <Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Data="{StaticResource Icons.Send}"/>
<TextBlock Grid.Column="1" Classes="monospace" Margin="8,0,0,0" Text="{DynamicResource Text.WorkingCopy}"/> <TextBlock Grid.Column="1" Classes="monospace" Text="{DynamicResource Text.WorkingCopy}"/>
<Border Grid.Column="2" <Border Grid.Column="2"
Margin="6,0" Margin="6,0"
Height="18" Height="18"
@ -137,9 +138,9 @@
</ListBoxItem> </ListBoxItem>
<ListBoxItem Height="28" Padding="0"> <ListBoxItem Height="28" Padding="0">
<Grid Margin="16,0,0,0" Height="28" ColumnDefinitions="Auto,*,Auto"> <Grid Margin="16,0,0,0" Height="28" ColumnDefinitions="20,*,Auto">
<Path Grid.Column="0" Width="14" Height="14" Data="{StaticResource Icons.Stashes}"/> <Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Data="{StaticResource Icons.Stashes}"/>
<TextBlock Grid.Column="1" Classes="monospace" Margin="8,0,0,0" Text="{DynamicResource Text.Stashes}"/> <TextBlock Grid.Column="1" Classes="monospace" Text="{DynamicResource Text.Stashes}"/>
<Border Grid.Column="2" <Border Grid.Column="2"
Margin="6,0" Margin="6,0"
Height="18" Height="18"
@ -170,10 +171,10 @@
</TreeView.Styles> </TreeView.Styles>
<TreeView.ItemTemplate> <TreeView.ItemTemplate>
<TreeDataTemplate ItemsSource="{Binding Children}" x:DataType="{x:Type m:BranchTreeNode}"> <TreeDataTemplate ItemsSource="{Binding Children}" x:DataType="{x:Type m:BranchTreeNode}">
<Grid Height="24" ColumnDefinitions="Auto,*,Auto,Auto" Background="Transparent" ContextRequested="OnLocalBranchContextMenuRequested" DoubleTapped="OnDoubleTappedLocalBranchNode"> <Grid Height="24" ColumnDefinitions="20,*,Auto,Auto" Background="Transparent" ContextRequested="OnLocalBranchContextMenuRequested" DoubleTapped="OnDoubleTappedLocalBranchNode">
<Path Grid.Column="0" Classes="folder_icon" Width="10" Height="10" Margin="0,1,0,0" IsVisible="{Binding IsFolder}"/> <Path Grid.Column="0" Classes="folder_icon" Width="12" Height="12" HorizontalAlignment="Left" Margin="0,1,0,0" IsVisible="{Binding IsFolder}"/>
<Path Grid.Column="0" Width="10" Height="10" Margin="0,2,0,0" Data="{StaticResource Icons.Check}" IsVisible="{Binding IsCurrent}" VerticalAlignment="Center"/> <Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Margin="0,2,0,0" Data="{StaticResource Icons.Check}" IsVisible="{Binding IsCurrent}" VerticalAlignment="Center"/>
<Path Grid.Column="0" Width="10" Height="10" Data="{StaticResource Icons.Branch}" VerticalAlignment="Center"> <Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Margin="2,0,0,0" Data="{StaticResource Icons.Branch}" VerticalAlignment="Center">
<Path.IsVisible> <Path.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}"> <MultiBinding Converter="{x:Static BoolConverters.And}">
<Binding Path="!IsFolder"/> <Binding Path="!IsFolder"/>
@ -181,8 +182,8 @@
</MultiBinding> </MultiBinding>
</Path.IsVisible> </Path.IsVisible>
</Path> </Path>
<TextBlock Grid.Column="1" Text="{Binding Name}" Classes="monospace" FontWeight="Bold" Margin="8,0,4,0" IsVisible="{Binding IsCurrent}"/>
<TextBlock Grid.Column="1" Text="{Binding Name}" Classes="monospace" Margin="8,0,4,0" IsVisible="{Binding !IsCurrent}"/> <TextBlock Grid.Column="1" Text="{Binding Name}" Classes="monospace" FontWeight="{Binding IsCurrent, Converter={x:Static c:BoolConverters.BoldIfTrue}}"/>
<Border Grid.Column="2" Margin="8,0" Height="18" CornerRadius="9" VerticalAlignment="Center" Background="{DynamicResource Brush.Badge}" IsVisible="{Binding IsUpstreamTrackStatusVisible}"> <Border Grid.Column="2" Margin="8,0" Height="18" CornerRadius="9" VerticalAlignment="Center" Background="{DynamicResource Brush.Badge}" IsVisible="{Binding IsUpstreamTrackStatusVisible}">
<TextBlock Classes="monospace" FontSize="10" HorizontalAlignment="Center" Margin="9,0" Text="{Binding UpstreamTrackStatus}"/> <TextBlock Classes="monospace" FontSize="10" HorizontalAlignment="Center" Margin="9,0" Text="{Binding UpstreamTrackStatus}"/>
@ -223,12 +224,12 @@
<TreeView.ItemTemplate> <TreeView.ItemTemplate>
<TreeDataTemplate ItemsSource="{Binding Children}" x:DataType="{x:Type m:BranchTreeNode}"> <TreeDataTemplate ItemsSource="{Binding Children}" x:DataType="{x:Type m:BranchTreeNode}">
<Grid Height="24" ColumnDefinitions="Auto,*,Auto" Background="Transparent" ContextRequested="OnRemoteBranchContextMenuRequested"> <Grid Height="24" ColumnDefinitions="20,*,Auto" Background="Transparent" ContextRequested="OnRemoteBranchContextMenuRequested">
<Path Grid.Column="0" Classes="folder_icon" Width="10" Height="10" Margin="0,2,0,0" IsVisible="{Binding IsFolder}" VerticalAlignment="Center"/> <Path Grid.Column="0" Classes="folder_icon" Width="10" Height="10" HorizontalAlignment="Left" Margin="0,2,0,0" IsVisible="{Binding IsFolder}" VerticalAlignment="Center"/>
<Path Grid.Column="0" Width="10" Height="10" Margin="0,4,0,0" Data="{StaticResource Icons.Remote}" IsVisible="{Binding IsRemote}" VerticalAlignment="Center"/> <Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Margin="0,2,0,0" Data="{StaticResource Icons.Remote}" IsVisible="{Binding IsRemote}" VerticalAlignment="Center"/>
<Path Grid.Column="0" Width="10" Height="10" Data="{StaticResource Icons.Branch}" IsVisible="{Binding IsBranch}" VerticalAlignment="Center"/> <Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Margin="2,0,0,0" Data="{StaticResource Icons.Branch}" IsVisible="{Binding IsBranch}" VerticalAlignment="Center"/>
<TextBlock Grid.Column="1" Text="{Binding Name}" Classes="monospace" Margin="8,0,4,0"/> <TextBlock Grid.Column="1" Text="{Binding Name}" Classes="monospace"/>
<ToggleButton Grid.Column="2" <ToggleButton Grid.Column="2"
Classes="filter" Classes="filter"
@ -318,7 +319,7 @@
<Path x:Name="iconSubmoduleUpdate" Width="12" Height="12" Data="{StaticResource Icons.Loading}"/> <Path x:Name="iconSubmoduleUpdate" Width="12" Height="12" Data="{StaticResource Icons.Loading}"/>
</Button> </Button>
<Button Grid.Column="3" Classes="icon_button" Width="14" Margin="0,0,8,0" Command="{Binding AddSubmodule}" ToolTip.Tip="{DynamicResource Text.Repository.Submodules.Add}"> <Button Grid.Column="3" Classes="icon_button" Width="14" Margin="0,0,8,0" Command="{Binding AddSubmodule}" ToolTip.Tip="{DynamicResource Text.Repository.Submodules.Add}">
<Path Width="12" Height="12" Data="{StaticResource Icons.Submodule}"/> <Path Width="12" Height="12" Data="{StaticResource Icons.Submodule.Add}"/>
</Button> </Button>
</Grid> </Grid>
</ToggleButton> </ToggleButton>

View file

@ -20,11 +20,11 @@
<Grid Grid.Column="0" RowDefinitions="28,*,28,*"> <Grid Grid.Column="0" RowDefinitions="28,*,28,*">
<!-- Stash Bar --> <!-- Stash Bar -->
<Border Grid.Row="0" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Brush.Border0}"> <Border Grid.Row="0" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Brush.Border0}">
<Grid ColumnDefinitions="Auto,Auto,*,Auto"> <Grid ColumnDefinitions="Auto,Auto,Auto,*,Auto">
<Path Grid.Column="0" Margin="8,0,0,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.Stashes}"/> <Path Grid.Column="0" Margin="8,0,0,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.Stashes}"/>
<TextBlock Grid.Column="1" Text="{DynamicResource Text.Stashes.Stashes}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold" Margin="8,0,0,0"/> <TextBlock Grid.Column="1" Text="{DynamicResource Text.Stashes.Stashes}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold" Margin="8,0,0,0"/>
<TextBlock Grid.Column="2" Text="{Binding Stashes, Converter={x:Static c:ListConverters.ToCount}}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
<Button Grid.Column="3" <Button Grid.Column="4"
Classes="icon_button" Classes="icon_button"
Width="26" Height="14" Width="26" Height="14"
Padding="0" Padding="0"
@ -80,9 +80,10 @@
<!-- Changes Bar --> <!-- Changes Bar -->
<Border Grid.Row="2" BorderThickness="0,1" BorderBrush="{DynamicResource Brush.Border0}"> <Border Grid.Row="2" BorderThickness="0,1" BorderBrush="{DynamicResource Brush.Border0}">
<Grid ColumnDefinitions="Auto,Auto,Auto,*,Auto"> <Grid ColumnDefinitions="Auto,Auto,*">
<Path Grid.Column="0" Margin="8,0,0,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.File}"/> <Path Grid.Column="0" Margin="8,0,0,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.File}"/>
<TextBlock Grid.Column="1" Text="{DynamicResource Text.Stashes.Changes}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold" Margin="8,0,0,0"/> <TextBlock Grid.Column="1" Text="{DynamicResource Text.Stashes.Changes}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold" Margin="8,0,0,0"/>
<TextBlock Grid.Column="2" Text="{Binding Changes, Converter={x:Static c:ListConverters.ToCount}}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
</Grid> </Grid>
</Border> </Border>