From fb37d3b9e68611e967d15c4dfecd72867e432d6f Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Sat, 27 Sep 2025 17:52:25 +0800 Subject: [PATCH] =?UTF-8?q?improve:=E6=9B=B4=E6=96=B0=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/Helpers/GlobalHotkeyManager.cs | 4 +- .../MainWindow_cs/MW_FloatingBarIcons.cs | 25 ++ Ink Canvas/Resources/Styles/Dark.xaml | 9 + Ink Canvas/Resources/Styles/Light.xaml | 9 + Ink Canvas/Windows/HasNewUpdateWindow.xaml | 170 ++++---- Ink Canvas/Windows/HasNewUpdateWindow.xaml.cs | 126 ++++++ Ink Canvas/Windows/HistoryRollbackWindow.xaml | 398 +++++++++--------- .../Windows/HistoryRollbackWindow.xaml.cs | 110 ++++- 8 files changed, 571 insertions(+), 280 deletions(-) diff --git a/Ink Canvas/Helpers/GlobalHotkeyManager.cs b/Ink Canvas/Helpers/GlobalHotkeyManager.cs index 85cee823..917ee3f8 100644 --- a/Ink Canvas/Helpers/GlobalHotkeyManager.cs +++ b/Ink Canvas/Helpers/GlobalHotkeyManager.cs @@ -774,7 +774,7 @@ namespace Ink_Canvas.Helpers return; // 检查鼠标是否在当前窗口所在的屏幕上 - var mousePosition = System.Windows.Forms.Control.MousePosition; + var mousePosition = Control.MousePosition; var currentScreen = Screen.FromPoint(mousePosition); // 无论屏幕是否变化,都检查热键状态 @@ -880,7 +880,7 @@ namespace Ink_Canvas.Helpers // 策略2:在多屏幕环境下,检查鼠标是否在当前窗口所在的屏幕上 if (_isMultiScreenMode) { - var mousePosition = System.Windows.Forms.Control.MousePosition; + var mousePosition = Control.MousePosition; var mouseScreen = Screen.FromPoint(mousePosition); if (mouseScreen == _currentScreen) diff --git a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs index 3bf1f1e5..7b4b48e5 100644 --- a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs +++ b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs @@ -2700,6 +2700,19 @@ namespace Ink_Canvas public void BtnExit_Click(object sender, RoutedEventArgs e) { + // 如果当前在设置面板中,需要先恢复无焦点模式状态 + if (BorderSettings.Visibility == Visibility.Visible) + { + // 如果用户没有在设置中修改无焦点模式,则恢复之前的状态 + if (!userChangedNoFocusModeInSettings && wasNoFocusModeBeforeSettings) + { + Settings.Advanced.IsNoFocusMode = true; + ToggleSwitchNoFocusMode.IsOn = true; + ApplyNoFocusMode(); + } + SaveSettingsToFile(); + } + App.IsAppExitByUser = true; // 不设置 CloseIsFromButton = true,让它也经过确认流程 Close(); @@ -2707,6 +2720,18 @@ namespace Ink_Canvas public void BtnRestart_Click(object sender, RoutedEventArgs e) { + if (BorderSettings.Visibility == Visibility.Visible) + { + // 如果用户没有在设置中修改无焦点模式,则恢复之前的状态 + if (!userChangedNoFocusModeInSettings && wasNoFocusModeBeforeSettings) + { + Settings.Advanced.IsNoFocusMode = true; + ToggleSwitchNoFocusMode.IsOn = true; + ApplyNoFocusMode(); + } + SaveSettingsToFile(); + } + Process.Start(System.Windows.Forms.Application.ExecutablePath, "-m"); App.IsAppExitByUser = true; // 不设置 CloseIsFromButton = true,让它也经过确认流程 diff --git a/Ink Canvas/Resources/Styles/Dark.xaml b/Ink Canvas/Resources/Styles/Dark.xaml index e04f7855..3a5f14bb 100644 --- a/Ink Canvas/Resources/Styles/Dark.xaml +++ b/Ink Canvas/Resources/Styles/Dark.xaml @@ -29,4 +29,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/Ink Canvas/Resources/Styles/Light.xaml b/Ink Canvas/Resources/Styles/Light.xaml index bcf1db1f..00943f56 100644 --- a/Ink Canvas/Resources/Styles/Light.xaml +++ b/Ink Canvas/Resources/Styles/Light.xaml @@ -29,4 +29,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/Ink Canvas/Windows/HasNewUpdateWindow.xaml b/Ink Canvas/Windows/HasNewUpdateWindow.xaml index 793d028c..bc7620b0 100644 --- a/Ink Canvas/Windows/HasNewUpdateWindow.xaml +++ b/Ink Canvas/Windows/HasNewUpdateWindow.xaml @@ -7,61 +7,68 @@ xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" xmlns:mdxam="clr-namespace:MdXaml;assembly=MdXaml" mc:Ignorable="d" - ui:WindowHelper.UseModernWindowStyle = "False" + ui:WindowHelper.UseModernWindowStyle="False" ui:WindowHelper.SystemBackdropType="Mica" Title="InkCanvasForClass CE有新版本可用" Height="650" Width="900" ResizeMode="NoResize" - WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="True" + WindowStartupLocation="CenterScreen" WindowStyle="None" Background="Transparent"> - + - + + + + + + + + + + + - - + + - - - - - - + + + + - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - + SelectionChanged="VersionComboBox_SelectionChanged"/> + + + + + + + + + + + + + + + + + + + + + + + +