diff --git a/Ink Canvas/MainWindow.xaml b/Ink Canvas/MainWindow.xaml index ec836c63..fad91b88 100644 --- a/Ink Canvas/MainWindow.xaml +++ b/Ink Canvas/MainWindow.xaml @@ -24,7 +24,7 @@ Closing="Window_Closing" Closed="Window_Closed" PreviewKeyDown="Main_Grid_PreviewKeyDown" - Height="9000" Width="1440" + Height="16000" Width="1440" FontFamily="Microsoft YaHei UI" MouseWheel="Window_MouseWheel" Foreground="{DynamicResource FloatBarForeground}" diff --git a/Ink Canvas/Windows/HistoryRollbackWindow.xaml.cs b/Ink Canvas/Windows/HistoryRollbackWindow.xaml.cs index 67755648..a3289ec3 100644 --- a/Ink Canvas/Windows/HistoryRollbackWindow.xaml.cs +++ b/Ink Canvas/Windows/HistoryRollbackWindow.xaml.cs @@ -41,16 +41,16 @@ namespace Ink_Canvas // 应用当前主题 ApplyCurrentTheme(); - // 折叠浮动工具栏 - CollapseFloatingBar(); + // 隐藏主窗口 + HideMainWindow(); LoadVersions(); } /// - /// 折叠主窗口的浮动工具栏 + /// 隐藏主窗口 /// - private async void CollapseFloatingBar() + private void HideMainWindow() { try { @@ -58,13 +58,13 @@ namespace Ink_Canvas var mainWindow = Application.Current.MainWindow as MainWindow; if (mainWindow != null) { - // 调用折叠方法 - await mainWindow.FoldFloatingBar(null); + // 隐藏主窗口 + mainWindow.Visibility = Visibility.Hidden; } } catch (Exception ex) { - LogHelper.WriteLogToFile($"折叠浮动工具栏时出错: {ex.Message}", LogHelper.LogType.Error); + LogHelper.WriteLogToFile($"隐藏主窗口时出错: {ex.Message}", LogHelper.LogType.Error); } } @@ -346,6 +346,22 @@ namespace Ink_Canvas protected override void OnClosing(CancelEventArgs e) { downloadCts?.Cancel(); + + try + { + // 获取主窗口实例 + var mainWindow = Application.Current.MainWindow as MainWindow; + if (mainWindow != null) + { + // 重新显示主窗口 + mainWindow.Visibility = Visibility.Visible; + } + } + catch (Exception ex) + { + LogHelper.WriteLogToFile($"显示主窗口时出错: {ex.Message}", LogHelper.LogType.Error); + } + base.OnClosing(e); }