add:软件启动动画
This commit is contained in:
@@ -530,7 +530,7 @@ namespace Ink_Canvas
|
||||
try { crashAction = (int)(obj["startup"]["crashAction"] ?? 0); } catch { }
|
||||
CrashAction = (CrashActionType)crashAction;
|
||||
}
|
||||
// 兜底:从主窗口同步
|
||||
// 从主窗口同步
|
||||
else if (Ink_Canvas.MainWindow.Settings != null && Ink_Canvas.MainWindow.Settings.Startup != null)
|
||||
{
|
||||
CrashAction = (CrashActionType)Ink_Canvas.MainWindow.Settings.Startup.CrashAction;
|
||||
@@ -544,13 +544,13 @@ namespace Ink_Canvas
|
||||
Ink_Canvas.MainWindow.ShowNewMessage("抱歉,出现未预期的异常,可能导致 InkCanvasForClass 运行不稳定。\n建议保存墨迹后重启应用。");
|
||||
LogHelper.NewLog(e.Exception.ToString());
|
||||
|
||||
// 新增:记录到崩溃日志
|
||||
// 记录到崩溃日志
|
||||
lastErrorMessage = e.Exception.ToString();
|
||||
WriteCrashLog($"UI线程未处理异常: {e.Exception}");
|
||||
|
||||
e.Handled = true;
|
||||
|
||||
SyncCrashActionFromSettings(); // 新增:崩溃时同步最新设置
|
||||
SyncCrashActionFromSettings(); // 崩溃时同步最新设置
|
||||
|
||||
if (CrashAction == CrashActionType.SilentRestart && !IsAppExitByUser)
|
||||
{
|
||||
@@ -879,10 +879,8 @@ namespace Ink_Canvas
|
||||
{
|
||||
SetSplashMessage("启动完成!");
|
||||
SetSplashProgress(100);
|
||||
SetSplashProgress(500);
|
||||
|
||||
// 延迟关闭启动画面,让用户看到完成消息
|
||||
Task.Delay(800).ContinueWith(_ =>
|
||||
Task.Delay(500).ContinueWith(_ =>
|
||||
{
|
||||
Dispatcher.Invoke(() => CloseSplashScreen());
|
||||
});
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
<StackPanel>
|
||||
<!-- 启动图片 -->
|
||||
<Image x:Name="StartupImage"
|
||||
Source="pack://application:,,,/Resources/Startup-animation/ICC Autumn.png"
|
||||
Width="600"
|
||||
Height="450"
|
||||
Stretch="Uniform" />
|
||||
@@ -41,23 +40,27 @@
|
||||
FontWeight="SemiBold"
|
||||
Foreground="White"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,-150,0,0" />
|
||||
Margin="0,-150,0,140" />
|
||||
|
||||
<!-- 进度条 -->
|
||||
<Grid HorizontalAlignment="Center"
|
||||
Margin="1,-175,0,0"
|
||||
Width="530"
|
||||
Margin="1,-200,0,0"
|
||||
Width="532"
|
||||
Height="10">
|
||||
<!-- 进度条填充 -->
|
||||
<Border x:Name="ProgressBarFill"
|
||||
Background="#0198D4"
|
||||
CornerRadius="2.5"
|
||||
HorizontalAlignment="Left"
|
||||
Width="0">
|
||||
</Border>
|
||||
<!-- 进度条填充 -->
|
||||
<Border x:Name="ProgressBarFill"
|
||||
Background="#41A5EE"
|
||||
HorizontalAlignment="Left"
|
||||
Width="0">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="0,0,7,7"/>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
</Border>
|
||||
<!-- 进度条背景 -->
|
||||
<Border x:Name="ProgressBarBackground"
|
||||
CornerRadius="2.5"
|
||||
CornerRadius="7"
|
||||
BorderThickness="1"
|
||||
ClipToBounds="True"/>
|
||||
</Grid>
|
||||
|
||||
@@ -130,6 +130,18 @@ namespace Ink_Canvas.Windows
|
||||
{
|
||||
// 确保最终值正确设置
|
||||
ProgressBarFill.Width = targetWidth;
|
||||
|
||||
// 根据进度调整圆角
|
||||
if (progress >= 100)
|
||||
{
|
||||
// 进度100%时,底部角都是圆角
|
||||
ProgressBarFill.CornerRadius = new CornerRadius(0, 0, 7, 7);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 进度未满时,只有左侧是圆角
|
||||
ProgressBarFill.CornerRadius = new CornerRadius(0, 0, 0, 7);
|
||||
}
|
||||
};
|
||||
|
||||
// 开始动画
|
||||
|
||||
Reference in New Issue
Block a user