Skip to content

Commit 4c02699

Browse files
committed
feat: 在关于页面添加可点击版本徽章及GitHub发布链接
- Add clickable version badge with GitHub release link in About view. - Add GitHub version release link handler to open browser with specific release tag.
1 parent 2b7bd2e commit 4c02699

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Views/About.axaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
<StackPanel Grid.Column="1" Orientation="Vertical" VerticalAlignment="Center">
4646
<StackPanel Height="40" Orientation="Horizontal">
4747
<TextBlock Classes="bold" Text="SourceGit" FontSize="32" />
48-
<Border Margin="12,0,0,0" Height="20" CornerRadius="10" Background="{DynamicResource Brush.Accent}" Effect="drop-shadow(0 0 6 #40000000)">
48+
<Border Margin="12,0,0,0" Height="20" CornerRadius="10" Background="{DynamicResource Brush.Accent}" Effect="drop-shadow(0 0 6 #40000000)"
49+
Cursor="Hand"
50+
PointerPressed="OnVisitGithubRelease">
4951
<TextBlock x:Name="TxtVersion" Classes="primary" Margin="8,0" FontSize="12" Foreground="White"/>
5052
</Border>
5153
</StackPanel>

src/Views/About.axaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ public About()
2020
TxtCopyright.Text = copyright.Copyright;
2121
}
2222

23+
private void OnVisitGithubRelease(object _, RoutedEventArgs e)
24+
{
25+
Native.OS.OpenBrowser($"https://github.com/sourcegit-scm/sourcegit/releases/tag/v{TxtVersion.Text}");
26+
e.Handled = true;
27+
}
28+
2329
private void OnVisitWebsite(object _, RoutedEventArgs e)
2430
{
2531
Native.OS.OpenBrowser("https://sourcegit-scm.github.io/");

0 commit comments

Comments
 (0)