This commit is contained in:
QWQLwToo
2026-07-12 09:12:12 +08:00
parent b22914b5de
commit ef25f8875c
43 changed files with 2797 additions and 709 deletions
+3 -19
View File
@@ -1,4 +1,4 @@
using System.Diagnostics;
using System.Diagnostics;
using Microsoft.UI.Text;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
@@ -783,26 +783,10 @@ public sealed class AboutPage : Page
private async Task ShowUpdateDialogAsync(RemoteUpdateInfo info, string current)
{
var content = new StackPanel
{
Spacing = 10,
Children =
{
ModernUi.Text(string.IsNullOrWhiteSpace(info.Title) ? AppLocalizer.T("发现新版本", "New version available") : AppLocalizer.SanitizeSensitiveText(info.Title, 120), 18, FontWeights.SemiBold),
ModernUi.Text(string.IsNullOrWhiteSpace(info.DisplayMessage) ? AppLocalizer.T("远程发布信息未提供摘要。", "No release summary was provided.") : AppLocalizer.SanitizeSensitiveText(info.DisplayMessage, 300), 14, foreground: ModernUi.TextSecondary),
BuildUpdateLine(AppLocalizer.T("最新版本", "Latest"), info.DisplayVersion),
BuildUpdateLine(AppLocalizer.T("当前版本", "Current"), current),
BuildUpdateLine(AppLocalizer.T("发布通道", "Channel"), string.IsNullOrWhiteSpace(info.Channel) ? "-" : info.Channel),
BuildUpdateLine(AppLocalizer.T("发布时间", "Published"), info.PublishedAt?.ToLocalTime().ToString("yyyy-MM-dd HH:mm") ?? "-"),
BuildUpdateLine(AppLocalizer.T("强制更新", "Mandatory"), info.Mandatory ? AppLocalizer.T("是", "Yes") : AppLocalizer.T("否", "No")),
MarkdownRenderHelper.Render(string.IsNullOrWhiteSpace(info.DisplayReleaseNotes) ? AppLocalizer.T("暂无发布说明。", "No release notes.") : info.DisplayReleaseNotes)
}
};
var dialog = new ContentDialog
{
Title = AppLocalizer.T("软件更新", "Software update"),
Content = content,
Content = ModernUi.GutterScroll(UpdateNoticeRenderer.Render(info.Notice, UpdateNoticeRenderMode.UpdatePrompt, current), 620),
PrimaryButtonText = AppLocalizer.T("立即更新", "Update now"),
SecondaryButtonText = AppLocalizer.T("稍后", "Later"),
CloseButtonText = AppLocalizer.T("取消", "Cancel"),
@@ -824,7 +808,6 @@ public sealed class AboutPage : Page
SetCheckingState(false);
await ShowDownloadDialogAsync(info);
}
private async Task ShowDownloadDialogAsync(RemoteUpdateInfo info)
{
await StartDownloadUpdateAsync(info);
@@ -963,3 +946,4 @@ public sealed class AboutPage : Page
}
}