Skip to content

Commit 93ffec6

Browse files
committed
xui: add "About GCM" dialog window
1 parent 5bd96b9 commit 93ffec6

File tree

5 files changed

+110
-1
lines changed

5 files changed

+110
-1
lines changed

assets/gcm.xaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Stretch="Uniform">
3+
<Canvas Name="svg815" Width="256" Height="256">
4+
<Canvas.RenderTransform>
5+
<TranslateTransform X="0" Y="0"/>
6+
</Canvas.RenderTransform>
7+
<Canvas.Resources/>
8+
<Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path8" Fill="#FFF05033" StrokeThickness="2.24708056">
9+
<Path.Data>
10+
<PathGeometry Figures="m 127.74219 0 c -4.21881 0 -8.43843 1.6093415 -11.65821 4.828125 L 92.875 28.041016 122.31445 57.482422 c 6.84425 -2.310946 14.68947 -0.761046 20.14258 4.693359 5.48141 5.488392 7.0192 13.400136 4.65039 20.267578 l 28.37696 28.376951 c 6.86492 -2.36579 14.78398 -0.83727 20.26562 4.6543 7.66374 7.66179 7.66374 20.07642 0 27.74023 -7.66486 7.66631 -20.07893 7.66631 -27.74805 0 -5.76254 -5.76724 -7.18821 -14.23373 -4.26953 -21.33398 l -26.46289 -26.464844 -0.002 69.640624 c 1.8684 0.92496 3.63248 2.16064 5.18945 3.71094 7.66148 7.6609 7.66148 20.07236 0 27.74609 -7.66374 7.66066 -20.08459 7.66066 -27.74023 0 -7.66262 -7.67305 -7.66262 -20.08452 0 -27.74609 1.89369 -1.89039 4.08382 -3.32218 6.42187 -4.28125 V 94.199219 c -2.33912 -0.955028 -4.52734 -2.375687 -6.42383 -4.28125 -5.80409 -5.799832 -7.20125 -14.319608 -4.22461 -21.447266 L 81.466797 39.443359 4.8300781 116.08203 c -6.4393305 6.44252 -6.4393305 16.88229 0 23.32031 L 42.5 177.07227 V 162.70508 C 35.078345 157.16403 29.678851 149.02425 27.328125 140.07617 19.76286 115.647 40.902921 87.908596 66.359375 88.345703 76.747705 88.003924 87.132367 91.94485 94.875 98.837891 c 18.78493 15.372969 17.87151 47.496839 -0.888672 62.484379 l -2.566406 1.3457 0.222656 12.46503 -8.160156 8.24395 v 34.67578 l 33.119138 33.11915 c 6.43505 6.43757 16.87041 6.43757 23.31446 0 L 251.17188 139.92969 c 6.43732 -6.4407 6.43732 -16.88336 0 -23.32227 l 0.002 -0.01 L 139.39453 4.828125 C 136.1788 1.6093415 131.96099 0 127.74219 0 Z" FillRule="NonZero"/>
11+
</Path.Data>
12+
</Path>
13+
<Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path831" Fill="#FF4D4D4D" StrokeThickness="4.12109041">
14+
<Path.Data>
15+
<PathGeometry Figures="M 67.333984 94.333984 A 35.333332 35.333332 0 0 0 32 129.66602 A 35.333332 35.333332 0 0 0 48.5 159.54688 L 48.5 234.5 L 54.5 240 L 67 240 L 79 228 L 79 216.5 L 73 210 L 79 203.5 L 73 197 L 79 191 L 73 185.5 L 85.5 173 L 85.5 159.92188 A 35.333332 35.333332 0 0 0 102.66602 129.66602 A 35.333332 35.333332 0 0 0 67.333984 94.333984 z M 66.777344 109 A 9 9 0 0 1 75.777344 118 A 9 9 0 0 1 66.777344 127 A 9 9 0 0 1 57.777344 118 A 9 9 0 0 1 66.777344 109 z M 54.5 168 L 60.5 173 L 60.5 234.5 L 54.5 228 L 54.5 168 z " FillRule="NonZero"/>
16+
</Path.Data>
17+
</Path>
18+
</Canvas>
19+
</Viewbox>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<ResourceDictionary xmlns="https://github.com/avaloniaui"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3+
<DrawingImage x:Key="GcmLogo">
4+
<DrawingImage.Drawing>
5+
<DrawingGroup>
6+
<DrawingGroup.Children>
7+
<GeometryDrawing Brush="#FFF05033" Geometry="m 127.74219 0 c -4.21881 0 -8.43843 1.6093415 -11.65821 4.828125 L 92.875 28.041016 122.31445 57.482422 c 6.84425 -2.310946 14.68947 -0.761046 20.14258 4.693359 5.48141 5.488392 7.0192 13.400136 4.65039 20.267578 l 28.37696 28.376951 c 6.86492 -2.36579 14.78398 -0.83727 20.26562 4.6543 7.66374 7.66179 7.66374 20.07642 0 27.74023 -7.66486 7.66631 -20.07893 7.66631 -27.74805 0 -5.76254 -5.76724 -7.18821 -14.23373 -4.26953 -21.33398 l -26.46289 -26.464844 -0.002 69.640624 c 1.8684 0.92496 3.63248 2.16064 5.18945 3.71094 7.66148 7.6609 7.66148 20.07236 0 27.74609 -7.66374 7.66066 -20.08459 7.66066 -27.74023 0 -7.66262 -7.67305 -7.66262 -20.08452 0 -27.74609 1.89369 -1.89039 4.08382 -3.32218 6.42187 -4.28125 V 94.199219 c -2.33912 -0.955028 -4.52734 -2.375687 -6.42383 -4.28125 -5.80409 -5.799832 -7.20125 -14.319608 -4.22461 -21.447266 L 81.466797 39.443359 4.8300781 116.08203 c -6.4393305 6.44252 -6.4393305 16.88229 0 23.32031 L 42.5 177.07227 V 162.70508 C 35.078345 157.16403 29.678851 149.02425 27.328125 140.07617 19.76286 115.647 40.902921 87.908596 66.359375 88.345703 76.747705 88.003924 87.132367 91.94485 94.875 98.837891 c 18.78493 15.372969 17.87151 47.496839 -0.888672 62.484379 l -2.566406 1.3457 0.222656 12.46503 -8.160156 8.24395 v 34.67578 l 33.119138 33.11915 c 6.43505 6.43757 16.87041 6.43757 23.31446 0 L 251.17188 139.92969 c 6.43732 -6.4407 6.43732 -16.88336 0 -23.32227 l 0.002 -0.01 L 139.39453 4.828125 C 136.1788 1.6093415 131.96099 0 127.74219 0 Z" />
8+
<GeometryDrawing Brush="#FF4D4D4D" Geometry="M 67.333984 94.333984 A 35.333332 35.333332 0 0 0 32 129.66602 A 35.333332 35.333332 0 0 0 48.5 159.54688 L 48.5 234.5 L 54.5 240 L 67 240 L 79 228 L 79 216.5 L 73 210 L 79 203.5 L 73 197 L 79 191 L 73 185.5 L 85.5 173 L 85.5 159.92188 A 35.333332 35.333332 0 0 0 102.66602 129.66602 A 35.333332 35.333332 0 0 0 67.333984 94.333984 z M 66.777344 109 A 9 9 0 0 1 75.777344 118 A 9 9 0 0 1 66.777344 127 A 9 9 0 0 1 57.777344 118 A 9 9 0 0 1 66.777344 109 z M 54.5 168 L 60.5 173 L 60.5 234.5 L 54.5 228 L 54.5 168 z " />
9+
</DrawingGroup.Children>
10+
</DrawingGroup>
11+
</DrawingImage.Drawing>
12+
</DrawingImage>
13+
</ResourceDictionary>

src/shared/Microsoft.Git.CredentialManager.UI/AvaloniaApp.axaml.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Avalonia.Controls;
33
using Avalonia.Controls.ApplicationLifetimes;
44
using Avalonia.Markup.Xaml;
5+
using Microsoft.Git.CredentialManager.UI.Controls;
56

67
namespace Microsoft.Git.CredentialManager.UI
78
{
@@ -33,7 +34,8 @@ public override void OnFrameworkInitializationCompleted()
3334

3435
private void About(object sender, EventArgs e)
3536
{
36-
// TODO
37+
var window = new AboutWindow();
38+
window.Show();
3739
}
3840
}
3941
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<Window xmlns="https://github.com/avaloniaui"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
6+
x:Class="Microsoft.Git.CredentialManager.UI.Controls.AboutWindow"
7+
Title="About Git Credential Manager"
8+
CanResize="False" Width="300" SizeToContent="Height"
9+
Background="#F6F6F6">
10+
<Window.Resources>
11+
<ResourceDictionary>
12+
<ResourceDictionary.MergedDictionaries>
13+
<ResourceInclude Source="avares://Microsoft.Git.CredentialManager.UI/Assets/Images.axaml"/>
14+
</ResourceDictionary.MergedDictionaries>
15+
</ResourceDictionary>
16+
</Window.Resources>
17+
<Window.Styles>
18+
<StyleInclude Source="avares://Microsoft.Git.CredentialManager.UI/Assets/Controls.axaml"/>
19+
</Window.Styles>
20+
<StackPanel Margin="20">
21+
<Image HorizontalAlignment="Center"
22+
Margin="0,10,0,10"
23+
Source="{StaticResource GcmLogo}" Width="128" Height="128" />
24+
<TextBlock HorizontalAlignment="Center"
25+
Margin="0,5"
26+
FontWeight="Bold" FontSize="13"
27+
Text="Git Credential Manager" />
28+
<TextBlock HorizontalAlignment="Center"
29+
Margin="0,5"
30+
FontSize="13" TextWrapping="Wrap" TextAlignment="Center"
31+
Text="Secure, cross-platform Git credential storage for popular Git hosting services." />
32+
<Button HorizontalAlignment="Center"
33+
Margin="0,5"
34+
FontSize="12" Classes="hyperlink"
35+
Content="https://aka.ms/gcmcore"
36+
Click="ProjectButton_Click"/>
37+
<TextBlock HorizontalAlignment="Center"
38+
Margin="0,10,0,0"
39+
FontSize="11"
40+
Text="Copyright © Microsoft Corporation"/>
41+
</StackPanel>
42+
</Window>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System.Diagnostics;
2+
using Avalonia;
3+
using Avalonia.Controls;
4+
using Avalonia.Interactivity;
5+
using Avalonia.Markup.Xaml;
6+
7+
namespace Microsoft.Git.CredentialManager.UI.Controls
8+
{
9+
public class AboutWindow : Window
10+
{
11+
public AboutWindow()
12+
{
13+
InitializeComponent();
14+
#if DEBUG
15+
this.AttachDevTools();
16+
#endif
17+
}
18+
19+
private void InitializeComponent()
20+
{
21+
AvaloniaXamlLoader.Load(this);
22+
}
23+
24+
private void ProjectButton_Click(object sender, RoutedEventArgs e)
25+
{
26+
var psi = new ProcessStartInfo("https://aka.ms/gcmcore")
27+
{
28+
UseShellExecute = true
29+
};
30+
Process.Start(psi);
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)