mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07:00
Open in... Menu
New Icons
This commit is contained in:
parent
cde5fc8f73
commit
386987fbb1
9 changed files with 72 additions and 22 deletions
|
@ -1,4 +1,5 @@
|
|||
using System.Diagnostics;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
|
@ -30,14 +31,15 @@ namespace SourceGit.Native
|
|||
|
||||
public string FindVSCode()
|
||||
{
|
||||
if (File.Exists("/usr/share/code/code")) return "/usr/share/code/code";
|
||||
var toolPath = "/usr/share/code/code";
|
||||
if (File.Exists(toolPath)) return toolPath;
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public string FindFleet()
|
||||
{
|
||||
var path = "~/.local/share/JetBrains/Toolbox/apps/fleet/bin/Fleet";
|
||||
if (File.Exists(path)) return path;
|
||||
var toolPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}/.local/share/JetBrains/Toolbox/apps/fleet/bin/Fleet";
|
||||
if (File.Exists(toolPath)) return toolPath;
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
|
|
|
@ -103,15 +103,15 @@ namespace SourceGit.Native
|
|||
|
||||
public string FindVSCode()
|
||||
{
|
||||
var vscodePath = Environment.ExpandEnvironmentVariables("%USERPROFILE%\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe");
|
||||
if (File.Exists(vscodePath)) return vscodePath;
|
||||
var toolPath = Environment.ExpandEnvironmentVariables($"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe");
|
||||
if (File.Exists(toolPath)) return toolPath;
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public string FindFleet()
|
||||
{
|
||||
var vscodePath = Environment.ExpandEnvironmentVariables("%USERPROFILE%\\AppData\\Local\\Programs\\Fleet\\Fleet.exe");
|
||||
if (File.Exists(vscodePath)) return vscodePath;
|
||||
var toolPath = Environment.ExpandEnvironmentVariables($"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\\AppData\\Local\\Programs\\Fleet\\Fleet.exe");
|
||||
if (File.Exists(toolPath)) return toolPath;
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
|
|
13
src/SourceGit/Resources/ExternalToolIcons/vscode_icon.svg
Normal file
13
src/SourceGit/Resources/ExternalToolIcons/vscode_icon.svg
Normal file
|
@ -0,0 +1,13 @@
|
|||
<svg height="2455"
|
||||
viewBox="-11.9 -2 1003.9 995.6"
|
||||
width="2500"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m12.1 353.9s-24-17.3 4.8-40.4l67.1-60s19.2-20.2 39.5-2.6l619.2 468.8v224.8s-.3 35.3-45.6 31.4z"
|
||||
fill="#2489ca"/>
|
||||
<path d="m171.7 498.8-159.6 145.1s-16.4 12.2 0 34l74.1 67.4s17.6 18.9 43.6-2.6l169.2-128.3z"
|
||||
fill="#1070b3"/>
|
||||
<path d="m451.9 500 292.7-223.5-1.9-223.6s-12.5-48.8-54.2-23.4l-389.5 354.5z"
|
||||
fill="#0877b9"/>
|
||||
<path d="m697.1 976.2c17 17.4 37.6 11.7 37.6 11.7l228.1-112.4c29.2-19.9 25.1-44.6 25.1-44.6v-671.2c0-29.5-30.2-39.7-30.2-39.7l-197.7-95.3c-43.2-26.7-71.5 4.8-71.5 4.8s36.4-26.2 54.2 23.4v887.5c0 6.1-1.3 12.1-3.9 17.5-5.2 10.5-16.5 20.3-43.6 16.2z"
|
||||
fill="#3c99d4"/>
|
||||
</svg>
|
After Width: | Height: | Size: 769 B |
|
@ -80,7 +80,6 @@
|
|||
<StreamGeometry x:Key="Icons.Eye">M520 168C291 168 95 311 16 512c79 201 275 344 504 344 229 0 425-143 504-344-79-201-275-344-504-344zm0 573c-126 0-229-103-229-229s103-229 229-229c126 0 229 103 229 229s-103 229-229 229zm0-367c-76 0-137 62-137 137s62 137 137 137S657 588 657 512s-62-137-137-137z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.EyeClose">M734 128c-33-19-74-8-93 25l-41 70c-28-6-58-9-90-9-294 0-445 298-445 298s82 149 231 236l-31 54c-19 33-8 74 25 93 33 19 74 8 93-25L759 222C778 189 767 147 734 128zM305 512c0-115 93-208 207-208 14 0 27 1 40 4l-37 64c-1 0-2 0-2 0-77 0-140 63-140 140 0 26 7 51 20 71l-37 64C324 611 305 564 305 512zM771 301 700 423c13 27 20 57 20 89 0 110-84 200-192 208l-51 89c12 1 24 2 36 2 292 0 446-298 446-298S895 388 771 301z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Empty">M469 235V107h85v128h-85zm-162-94 85 85-60 60-85-85 60-60zm469 60-85 85-60-60 85-85 60 60zm-549 183A85 85 0 01302 341H722a85 85 0 0174 42l131 225A85 85 0 01939 652V832a85 85 0 01-85 85H171a85 85 0 01-85-85v-180a85 85 0 0112-43l131-225zM722 427H302l-100 171h255l10 29a59 59 0 002 5c2 4 5 9 9 14 8 9 18 17 34 17 16 0 26-7 34-17a72 72 0 0011-18l0-0 10-29h255l-100-171zM853 683H624a155 155 0 01-12 17C593 722 560 747 512 747c-48 0-81-25-99-47a155 155 0 01-12-17H171v149h683v-149z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.VSCode">M719 85 388 417l-209-165L87 299v427l92 47 210-164L720 939 939 850V171zM186 610V412l104 104zm526 55L514 512l198-153z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Statistics">M447 561a26 26 0 0126 26v171H421v-171a26 26 0 0126-26zm-98 65a26 26 0 0126 26v104H323v-104a26 26 0 0126-26zm0 0M561 268a32 32 0 0132 30v457h-65V299a32 32 0 0132-32zm0 0M675 384a26 26 0 0126 26v348H649v-350a26 26 0 0126-24zm0 0M801 223v579H223V223h579M805 171H219A49 49 0 00171 219v585A49 49 0 00219 853h585A49 49 0 00853 805V219A49 49 0 00805 171z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Hotkeys">M512 0C229.216 0 0 229.216 0 512c0 282.752 229.216 512 512 512s512-229.248 512-512c0-282.784-229.216-512-512-512z m0 957.92C266.112 957.92 66.08 757.888 66.08 512S266.112 66.08 512 66.08 957.92 266.112 957.92 512 757.888 957.92 512 957.92zM192 416h96a32 32 0 0 0 32-32v-32a32 32 0 0 0-32-32H192a32 32 0 0 0-32 32v32a32 32 0 0 0 32 32zM384 416h96a32 32 0 0 0 32-32v-32a32 32 0 0 0-32-32h-96a32 32 0 0 0-32 32v32a32 32 0 0 0 32 32zM576 416h96a32 32 0 0 0 32-32v-32a32 32 0 0 0-32-32h-96a32 32 0 0 0-32 32v32a32 32 0 0 0 32 32zM832 320h-64a32 32 0 0 0-32 32v128h-160a32 32 0 0 0-32 32v32a32 32 0 0 0 32 32h256a32 32 0 0 0 32-32v-192a32 32 0 0 0-32-32zM320 544v-32a32 32 0 0 0-32-32H192a32 32 0 0 0-32 32v32a32 32 0 0 0 32 32h96a32 32 0 0 0 32-32zM384 576h96a32 32 0 0 0 32-32v-32a32 32 0 0 0-32-32h-96a32 32 0 0 0-32 32v32a32 32 0 0 0 32 32zM800 640H256a32 32 0 0 0-32 32v32a32 32 0 0 0 32 32h544a32 32 0 0 0 32-32v-32a32 32 0 0 0-32-32z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.LayoutHorizontal">M875 117H149C109 117 75 151 75 192v640c0 41 34 75 75 75h725c41 0 75-34 75-75V192c0-41-34-75-75-75zM139 832V192c0-6 4-11 11-11h331v661H149c-6 0-11-4-11-11zm747 0c0 6-4 11-11 11H544v-661H875c6 0 11 4 11 11v640z</StreamGeometry>
|
||||
|
|
9
src/SourceGit/Resources/Locales.Designer.cs
generated
9
src/SourceGit/Resources/Locales.Designer.cs
generated
|
@ -2993,6 +2993,15 @@ namespace SourceGit.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Open in.
|
||||
/// </summary>
|
||||
public static string Text_Repository_OpenWith {
|
||||
get {
|
||||
return ResourceManager.GetString("Text.Repository.OpenWith", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Refresh.
|
||||
/// </summary>
|
||||
|
|
|
@ -1305,6 +1305,9 @@
|
|||
<data name="Text.Preference.Appearance" xml:space="preserve">
|
||||
<value>APPEARANCE</value>
|
||||
</data>
|
||||
<data name="Text.Repository.OpenWith" xml:space="preserve">
|
||||
<value>Open in</value>
|
||||
</data>
|
||||
<data name="Text.SelfUpdate.Title" xml:space="preserve">
|
||||
<value>Software Update</value>
|
||||
</data>
|
||||
|
|
|
@ -1305,6 +1305,9 @@
|
|||
<data name="Text.Preference.Appearance" xml:space="preserve">
|
||||
<value>Appearance</value>
|
||||
</data>
|
||||
<data name="Text.Repository.OpenWith" xml:space="preserve">
|
||||
<value>Open in</value>
|
||||
</data>
|
||||
<data name="Text.SelfUpdate.Title" xml:space="preserve">
|
||||
<value>Software Update</value>
|
||||
</data>
|
||||
|
|
|
@ -17,22 +17,34 @@
|
|||
<Button Classes="icon_button" Width="32" Command="{Binding OpenInFileManager}" ToolTip.Tip="{DynamicResource Text.Repository.Explore}">
|
||||
<Path Width="15" Height="13" Data="{StaticResource Icons.Folder.Open}"/>
|
||||
</Button>
|
||||
|
||||
<Button Classes="icon_button" Width="32" Command="{Binding OpenInVSCode}" IsVisible="{Binding IsVSCodeFound}" ToolTip.Tip="{DynamicResource Text.Repository.VSCode}">
|
||||
<Path Width="13" Height="13" Data="{StaticResource Icons.VSCode}"/>
|
||||
</Button>
|
||||
<Button Classes="icon_button" Width="32" Command="{Binding OpenInFleet}" IsVisible="{Binding IsFleetFound}" ToolTip.Tip="{DynamicResource Text.Repository.Fleet}" Content="{SvgImage /Resources/ExternalToolIcons/fleet_icon.svg}" />
|
||||
|
||||
<Button Classes="icon_button" Width="32" Command="{Binding OpenInTerminal}" ToolTip.Tip="{DynamicResource Text.Repository.Terminal}">
|
||||
<Path Width="13" Height="13" Data="{StaticResource Icons.Terminal}"/>
|
||||
</Button>
|
||||
|
||||
<Button Classes="icon_button" Width="32" ToolTip.Tip="{DynamicResource Text.Repository.OpenWith}">
|
||||
<Path Width="13" Height="13" Data="{StaticResource Icons.OpenWith}"/>
|
||||
<Button.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedLeft" VerticalOffset="-8">
|
||||
<MenuItem Header="{DynamicResource Text.Repository.Fleet}" Click="OpenInFleet">
|
||||
<MenuItem.Icon>
|
||||
<Svg Path="/Resources/ExternalToolIcons/fleet_icon.svg" Width="13" Height="13" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="{DynamicResource Text.Repository.VSCode}" Click="OpenInVSCode">
|
||||
<MenuItem.Icon>
|
||||
<Svg Path="/Resources/ExternalToolIcons/vscode_icon.svg" Width="13" Height="13" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuFlyout>
|
||||
</Button.Flyout>
|
||||
</Button>
|
||||
<ToggleButton Width="32"
|
||||
Background="Transparent"
|
||||
IsChecked="{Binding IsSearching, Mode=TwoWay}"
|
||||
ToolTip.Tip="{DynamicResource Text.Repository.Search}">
|
||||
<Path Width="14" Height="14" Data="{StaticResource Icons.Search}"/>
|
||||
</ToggleButton>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||||
|
|
|
@ -291,5 +291,14 @@ namespace SourceGit.Views
|
|||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenInVSCode(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(DataContext as ViewModels.Repository).OpenInVSCode();
|
||||
}
|
||||
private void OpenInFleet(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(DataContext as ViewModels.Repository).OpenInFleet();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue