From 8394e99127c932a397287864398b3f73c3af1b24 Mon Sep 17 00:00:00 2001 From: CJK_mkp <113243675+CJKmkp@users.noreply.github.com> Date: Sat, 1 Nov 2025 20:26:52 +0800 Subject: [PATCH] =?UTF-8?q?improve:=E4=B8=BB=E9=A2=98=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/InkCanvasForClass.csproj | 1 + Ink Canvas/MainWindow.xaml | 2 +- Ink Canvas/MainWindow_cs/MW_AutoTheme.cs | 21 +++++++++++++++++++ .../MainWindow_cs/MW_FloatingBarIcons.cs | 9 +++----- Ink Canvas/Resources/Styles/Dark.xaml | 4 ++++ Ink Canvas/Resources/Styles/Light.xaml | 4 ++++ 6 files changed, 34 insertions(+), 7 deletions(-) diff --git a/Ink Canvas/InkCanvasForClass.csproj b/Ink Canvas/InkCanvasForClass.csproj index 1c25b961..921824a8 100644 --- a/Ink Canvas/InkCanvasForClass.csproj +++ b/Ink Canvas/InkCanvasForClass.csproj @@ -421,6 +421,7 @@ + diff --git a/Ink Canvas/MainWindow.xaml b/Ink Canvas/MainWindow.xaml index c9d0d120..93032d3e 100644 --- a/Ink Canvas/MainWindow.xaml +++ b/Ink Canvas/MainWindow.xaml @@ -9434,7 +9434,7 @@ MouseUp="TwoFingerGestureBorder_MouseUp" Background="Transparent" Orientation="Vertical" HorizontalAlignment="Center" Width="36" Margin="0"> - + /// 刷新手势按钮图标 + /// + private void RefreshGestureButtonIcon() + { + try + { + // 调用手势按钮颜色和图标更新方法,该方法会根据当前主题和手势状态设置正确的图标 + CheckEnableTwoFingerGestureBtnColorPrompt(); + } + catch (Exception) + { + } + } + /// /// 刷新其他窗口的主题 /// diff --git a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs index 38b9ca94..c9bd64db 100644 --- a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs +++ b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs @@ -80,8 +80,7 @@ namespace Ink_Canvas // 多指书写模式启用时,手势功能被禁用 TwoFingerGestureSimpleStackPanel.Opacity = 0.5; TwoFingerGestureSimpleStackPanel.IsHitTestVisible = false; - EnableTwoFingerGestureBtn.Source = - new BitmapImage(new Uri("/Resources/new-icons/gesture.png", UriKind.Relative)); + EnableTwoFingerGestureBtn.Source = (BitmapImage)Application.Current.FindResource("GestureIcon"); // 根据主题设置颜色 if (Settings.Appearance.Theme == 1) // 深色主题 @@ -117,8 +116,7 @@ namespace Ink_Canvas if (hasGestureEnabled) { - EnableTwoFingerGestureBtn.Source = - new BitmapImage(new Uri("/Resources/new-icons/gesture-enabled.png", UriKind.Relative)); + EnableTwoFingerGestureBtn.Source = (BitmapImage)Application.Current.FindResource("GestureIconEnabled"); BoardGesture.Background = new SolidColorBrush(Color.FromRgb(37, 99, 235)); BoardGestureGeometry.Brush = new SolidColorBrush(Colors.GhostWhite); @@ -130,8 +128,7 @@ namespace Ink_Canvas } else { - EnableTwoFingerGestureBtn.Source = - new BitmapImage(new Uri("/Resources/new-icons/gesture.png", UriKind.Relative)); + EnableTwoFingerGestureBtn.Source = (BitmapImage)Application.Current.FindResource("GestureIcon"); // 根据主题设置颜色 if (Settings.Appearance.Theme == 1) // 深色主题 diff --git a/Ink Canvas/Resources/Styles/Dark.xaml b/Ink Canvas/Resources/Styles/Dark.xaml index b9761ed8..a6cd8bf9 100644 --- a/Ink Canvas/Resources/Styles/Dark.xaml +++ b/Ink Canvas/Resources/Styles/Dark.xaml @@ -145,4 +145,8 @@ + + + + \ No newline at end of file diff --git a/Ink Canvas/Resources/Styles/Light.xaml b/Ink Canvas/Resources/Styles/Light.xaml index 056d21bf..8f48ff49 100644 --- a/Ink Canvas/Resources/Styles/Light.xaml +++ b/Ink Canvas/Resources/Styles/Light.xaml @@ -145,4 +145,8 @@ + + + + \ No newline at end of file