mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
ux: add icons for external merge tools
This commit is contained in:
parent
f0e0c90621
commit
17fc7ab994
13 changed files with 68 additions and 31 deletions
|
@ -3,6 +3,9 @@ using System.Collections.Generic;
|
|||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
using Avalonia.Media.Imaging;
|
||||
using Avalonia.Platform;
|
||||
|
||||
namespace SourceGit.Models
|
||||
{
|
||||
public class ExternalTool
|
||||
|
@ -12,6 +15,15 @@ namespace SourceGit.Models
|
|||
public string Executable { get; set; } = string.Empty;
|
||||
public string OpenCmdArgs { get; set; } = string.Empty;
|
||||
|
||||
public Bitmap IconImage
|
||||
{
|
||||
get
|
||||
{
|
||||
var icon = AssetLoader.Open(new Uri($"avares://SourceGit/Resources/ExternalToolIcons/{Icon}.png", UriKind.RelativeOrAbsolute));
|
||||
return new Bitmap(icon);
|
||||
}
|
||||
}
|
||||
|
||||
public void Open(string repo)
|
||||
{
|
||||
Process.Start(new ProcessStartInfo()
|
||||
|
@ -34,22 +46,22 @@ namespace SourceGit.Models
|
|||
|
||||
public void VSCode(Func<string> platform_finder)
|
||||
{
|
||||
TryAdd("Visual Studio Code", "vscode.png", "\"{0}\"", "VSCODE_PATH", platform_finder);
|
||||
TryAdd("Visual Studio Code", "vscode", "\"{0}\"", "VSCODE_PATH", platform_finder);
|
||||
}
|
||||
|
||||
public void VSCodeInsiders(Func<string> platform_finder)
|
||||
{
|
||||
TryAdd("Visual Studio Code - Insiders", "vscode_insiders.png", "\"{0}\"", "VSCODE_INSIDERS_PATH", platform_finder);
|
||||
TryAdd("Visual Studio Code - Insiders", "vscode_insiders", "\"{0}\"", "VSCODE_INSIDERS_PATH", platform_finder);
|
||||
}
|
||||
|
||||
public void Fleet(Func<string> platform_finder)
|
||||
{
|
||||
TryAdd("JetBrains Fleet", "fleet.png", "\"{0}\"", "FLEET_PATH", platform_finder);
|
||||
TryAdd("JetBrains Fleet", "fleet", "\"{0}\"", "FLEET_PATH", platform_finder);
|
||||
}
|
||||
|
||||
public void SublimeText(Func<string> platform_finder)
|
||||
{
|
||||
TryAdd("Sublime Text", "sublime_text.png", "\"{0}\"", "SUBLIME_TEXT_PATH", platform_finder);
|
||||
TryAdd("Sublime Text", "sublime_text", "\"{0}\"", "SUBLIME_TEXT_PATH", platform_finder);
|
||||
}
|
||||
|
||||
public void TryAdd(string name, string icon, string args, string env, Func<string> finder)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue