Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit a1e7aa3

Browse files
committed
improved the updater's looks
1 parent 7e2cbd7 commit a1e7aa3

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

Interop/Updater/UpdateWindow.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6-
Width="500" Height="200" ResizeMode="NoResize" TitleCaps="False" ShowInTaskbar="False" WindowStyle="None" GlowBrush="{DynamicResource AccentColorBrush}" WindowStartupLocation="CenterOwner" >
5+
Width="500" Height="400" TitleCaps="False" ShowInTaskbar="False" GlowBrush="{DynamicResource AccentColorBrush}" WindowStartupLocation="CenterOwner" WindowStyle="None" >
76
<mahapps:MetroWindow.Resources>
87
<ResourceDictionary>
98
<ResourceDictionary.MergedDictionaries>
@@ -22,6 +21,7 @@
2221
<TextBlock Name="SubLine" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="50,25,0,0" FontSize="14" IsHitTestVisible="False" />
2322
<Button Name="ActionYesButton" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="50,25,0,0" Content="Yes" Width="50" Click="ActionYesButton_Click" />
2423
<Button Name="ActionNoButton" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="110,25,0,0" Content="No" Width="50" Click="ActionNoButton_Click" />
25-
<TextBox Name="DescriptionBox" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0,55,0,0" Height="145" VerticalScrollBarVisibility="Visible" IsReadOnly="True" />
26-
</Grid>
24+
<RichTextBox Name="DescriptionBox" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,55,0,0" VerticalScrollBarVisibility="Visible" IsReadOnly="True" />
25+
<Button x:Name="ActionGithubButton" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="170,25,0,0" Content="View on Github" Width="110" Click="ActionGithubButton_Click" />
26+
</Grid>
2727
</mahapps:MetroWindow>

Interop/Updater/UpdateWindow.xaml.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
using System.Reflection;
66
using System.Threading;
77
using System.Windows;
8+
using System.Windows.Controls;
9+
using Markdig;
810
using Octokit;
11+
using SPCode.Utils;
912

1013
namespace SPCode.Interop.Updater
1114
{
@@ -26,9 +29,9 @@ public UpdateWindow(UpdateInfo info) : this()
2629
{
2730
updateInfo = info;
2831

29-
Title = $"Version {info.Release.TagName} is Available!";
30-
DescriptionBox.Text = updateInfo.Release.Body;
31-
32+
Title = $"Version {info.Release.TagName} is available for download!";
33+
DescriptionBox.AppendText(Markdown.ToPlainText(updateInfo.Release.Body));
34+
3235
if (info.SkipDialog)
3336
{
3437
StartUpdate();
@@ -58,7 +61,7 @@ private void StartUpdate()
5861
Icon.Visibility = Visibility.Hidden;
5962
Progress.IsActive = true;
6063
MainLine.Text = "Updating to " + updateInfo.Release.TagName;
61-
SubLine.Text = "Downloading Updater";
64+
SubLine.Text = "Downloading updater...";
6265
var t = new Thread(UpdateDownloadWorker);
6366
t.Start();
6467
}
@@ -114,5 +117,10 @@ private void FinalizeUpdate()
114117

115118
Close();
116119
}
120+
121+
private void ActionGithubButton_Click(object sender, RoutedEventArgs e)
122+
{
123+
Process.Start(new ProcessStartInfo(Constants.GitHubLatestRelease));
124+
}
117125
}
118126
}

0 commit comments

Comments
 (0)