add:新设置

This commit is contained in:
2026-02-07 14:58:35 +08:00
parent 3c908feb95
commit a5b99c25ed
2 changed files with 30 additions and 7 deletions
@@ -32,7 +32,6 @@ namespace Ink_Canvas.Windows.SettingsViews
LoadSettings();
SwitchTab("Update");
CheckUpdateStatus();
LoadUpdateLog(MainWindow.Settings?.Startup?.UpdateChannel ?? UpdateChannel.Release);
ApplyTheme();
}
}
@@ -283,7 +282,7 @@ namespace Ink_Canvas.Windows.SettingsViews
}
else
{
LoadUpdateLog(updateChannel);
LoadUpdateLogAsFallback(updateChannel);
}
if (manualCheck)
@@ -308,7 +307,7 @@ namespace Ink_Canvas.Windows.SettingsViews
});
}
private async void LoadUpdateLog(UpdateChannel channel)
private async Task LoadUpdateLogAsFallback(UpdateChannel channel)
{
try
{
@@ -329,6 +328,28 @@ namespace Ink_Canvas.Windows.SettingsViews
}
}
private async void LoadUpdateLogWithPriority(UpdateChannel channel)
{
try
{
var (remoteVersion, lineGroup, releaseNotes) = await AutoUpdateHelper.CheckForUpdates(channel, false, false);
if (!string.IsNullOrEmpty(releaseNotes))
{
UpdateLogViewer.Markdown = releaseNotes;
}
else
{
await LoadUpdateLogAsFallback(channel);
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"加载更新日志失败: {ex.Message}");
await LoadUpdateLogAsFallback(channel);
}
}
private async void LoadHistoryVersions()
{
try
@@ -447,7 +468,7 @@ namespace Ink_Canvas.Windows.SettingsViews
new System.Windows.Controls.RadioButton { Tag = "Release" }, e);
UpdateUpdateChannelButtons(UpdateChannel.Release);
LoadHistoryVersions();
LoadUpdateLog(UpdateChannel.Release);
LoadUpdateLogWithPriority(UpdateChannel.Release);
break;
case "UpdateChannel_Preview":
@@ -459,7 +480,7 @@ namespace Ink_Canvas.Windows.SettingsViews
new System.Windows.Controls.RadioButton { Tag = "Preview" }, e);
UpdateUpdateChannelButtons(UpdateChannel.Preview);
LoadHistoryVersions();
LoadUpdateLog(UpdateChannel.Preview);
LoadUpdateLogWithPriority(UpdateChannel.Preview);
break;
case "UpdateChannel_Beta":
@@ -471,7 +492,7 @@ namespace Ink_Canvas.Windows.SettingsViews
new System.Windows.Controls.RadioButton { Tag = "Beta" }, e);
UpdateUpdateChannelButtons(UpdateChannel.Beta);
LoadHistoryVersions();
LoadUpdateLog(UpdateChannel.Beta);
LoadUpdateLogWithPriority(UpdateChannel.Beta);
break;
}
}
@@ -199,7 +199,9 @@
<DrawingImage x:Key="UpdateCenterIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,16z M0,0z M2,8C2,11.3087 4.69134,14 8,14C11.3087,14 14,11.3087 14,8C14,4.69133 11.3087,2 8,2C4.69134,2 2,4.69133 2,8ZM16,8C16,12.4233 12.4233,16 8,16C3.57668,16 0,12.4233 0,8C0,3.57668 3.57668,0 8,0C12.4233,0 16,3.57668 16,8Z"/>
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,16z M0,0z M10.2929,8.70711L7.29288,5.70711H8.70712L5.70712,8.70711C5.51959,8.89465 5.26522,9.00001 5,9.00001C4.73478,9.00001 4.48044,8.89465 4.29291,8.70711C4.10537,8.51958 4,8.26522 4,8.00001C4,7.73479 4.10534,7.48043 4.29288,7.2929L7.29288,4.2929C7.38574,4.20004 7.49598,4.12638 7.61731,4.07612C7.73864,4.02587 7.86868,4 8,4C8.13132,4 8.26136,4.02587 8.38269,4.07612C8.50402,4.12638 8.61426,4.20004 8.70712,4.2929L11.7071,7.2929C11.8947,7.48043 12,7.73479 12,8.00001C12,8.26522 11.8946,8.51958 11.7071,8.70711C11.5196,8.89465 11.2652,9.00001 11,9.00001C10.7348,9.00001 10.4804,8.89465 10.2929,8.70711z"/>
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,16z M0,0z M9,5V11C9,11.2652 8.89463,11.5196 8.70709,11.7071C8.51956,11.8946 8.26522,12 8,12C7.73478,12 7.48044,11.8946 7.29291,11.7071C7.10537,11.5196 7,11.2652 7,11V5C7,4.73478 7.10537,4.48043 7.29291,4.29289C7.48044,4.10536 7.73478,4 8,4C8.26522,4 8.51956,4.10536 8.70709,4.29289C8.89463,4.48043 9,4.73478 9,5z"/>
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,16z M0,0z M2,8C2,11.3087 4.69134,14 8,14C11.3087,14 14,11.3087 14,8C14,4.69133 11.3087,2 8,2C4.69134,2 2,4.69133 2,8ZM16,8C16,12.4233 12.4233,16 8,16C3.57668,16 0,12.4233 0,8C0,3.57668 3.57668,0 8,0C12.4233,0 16,3.57668 16,8z"/>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>