From 41a59136c7702693f1dff3dae2a8007131d7409d Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Fri, 1 May 2026 22:05:30 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E4=B8=BB=E9=A2=98):=20=E5=B0=86?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E7=9B=B8=E5=85=B3=E9=80=BB=E8=BE=91=E6=8F=90?= =?UTF-8?q?=E5=8F=96=E5=88=B0ThemeHelper=E7=B1=BB=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/MainWindow.xaml.cs | 4 ++-- Ink Canvas/MainWindow_cs/MW_AutoTheme.cs | 4 ++-- Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs | 10 +++++----- Ink Canvas/Windows/MinimizedTimerControl.xaml.cs | 2 +- Ink Canvas/Windows/OobeWindow.xaml.cs | 1 - 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Ink Canvas/MainWindow.xaml.cs b/Ink Canvas/MainWindow.xaml.cs index 5dabdb55..890763fd 100644 --- a/Ink Canvas/MainWindow.xaml.cs +++ b/Ink Canvas/MainWindow.xaml.cs @@ -1212,7 +1212,7 @@ namespace Ink_Canvas SetTheme("Dark"); break; case 2: // 跟随系统 - if (IsSystemThemeLight()) + if (ThemeHelper.IsSystemThemeLight()) { ThemeManager.Current.ApplicationTheme = ApplicationTheme.Light; SetTheme("Light"); @@ -3265,7 +3265,7 @@ namespace Ink_Canvas ViewboxFloatingBar.Opacity = 1.0; break; case 2: // 跟随系统 - if (IsSystemThemeLight()) + if (ThemeHelper.IsSystemThemeLight()) { SetTheme("Light", true); ViewboxFloatingBar.Opacity = 1.0; diff --git a/Ink Canvas/MainWindow_cs/MW_AutoTheme.cs b/Ink Canvas/MainWindow_cs/MW_AutoTheme.cs index e0835429..fa7edd3b 100644 --- a/Ink Canvas/MainWindow_cs/MW_AutoTheme.cs +++ b/Ink Canvas/MainWindow_cs/MW_AutoTheme.cs @@ -1,5 +1,5 @@ -using iNKORE.UI.WPF.Modern; using Ink_Canvas.Helpers; +using iNKORE.UI.WPF.Modern; using Microsoft.Win32; using System; using System.Collections.Generic; @@ -153,7 +153,7 @@ namespace Ink_Canvas private bool IsCurrentThemeDark() { return Settings.Appearance.Theme == 1 || - (Settings.Appearance.Theme == 2 && !IsSystemThemeLight()); + (Settings.Appearance.Theme == 2 && !ThemeHelper.IsSystemThemeLight()); } private void RefreshFloatingBarButtonColors() diff --git a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs index 55219566..20c184b5 100644 --- a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs +++ b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs @@ -62,7 +62,7 @@ namespace Ink_Canvas { // 根据主题选择手势图标和颜色 bool isDarkTheme = Settings.Appearance.Theme == 1 || - (Settings.Appearance.Theme == 2 && !IsSystemThemeLight()); + (Settings.Appearance.Theme == 2 && !ThemeHelper.IsSystemThemeLight()); bool isLightTheme = !isDarkTheme; string gestureIconPath = isLightTheme ? "/Resources/new-icons/gesture.png" : "/Resources/new-icons/gesture_white.png"; @@ -422,7 +422,7 @@ namespace Ink_Canvas SymbolIconSelect.Icon.Geometry = Geometry.Parse(GetCorrectIcon("lassoSelect", false)); bool isDarkThemeForButtons = Settings.Appearance.Theme == 1 || - (Settings.Appearance.Theme == 2 && !IsSystemThemeLight()); + (Settings.Appearance.Theme == 2 && !ThemeHelper.IsSystemThemeLight()); if (isDarkThemeForButtons) { BoardPen.Background = new SolidColorBrush(Color.FromRgb(42, 42, 42)); @@ -460,7 +460,7 @@ namespace Ink_Canvas // 根据主题选择高光颜色 Color highlightColor; bool isDarkTheme = Settings.Appearance.Theme == 1 || - (Settings.Appearance.Theme == 2 && !IsSystemThemeLight()); + (Settings.Appearance.Theme == 2 && !ThemeHelper.IsSystemThemeLight()); if (isDarkTheme) { @@ -531,7 +531,7 @@ namespace Ink_Canvas Cursor_Icon.Icon.Geometry = Geometry.Parse(GetCorrectIcon("cursor", true)); bool isDarkThemeForCursor = Settings.Appearance.Theme == 1 || - (Settings.Appearance.Theme == 2 && !IsSystemThemeLight()); + (Settings.Appearance.Theme == 2 && !ThemeHelper.IsSystemThemeLight()); if (isDarkThemeForCursor) { BoardPen.Background = new SolidColorBrush(Color.FromRgb(42, 42, 42)); @@ -4268,7 +4268,7 @@ namespace Ink_Canvas Color highlightBackgroundColor; Color highlightBarColor; bool isDarkTheme = Settings.Appearance.Theme == 1 || - (Settings.Appearance.Theme == 2 && !IsSystemThemeLight()); + (Settings.Appearance.Theme == 2 && !ThemeHelper.IsSystemThemeLight()); if (isDarkTheme) { diff --git a/Ink Canvas/Windows/MinimizedTimerControl.xaml.cs b/Ink Canvas/Windows/MinimizedTimerControl.xaml.cs index c287f5b0..1b9d9e93 100644 --- a/Ink Canvas/Windows/MinimizedTimerControl.xaml.cs +++ b/Ink Canvas/Windows/MinimizedTimerControl.xaml.cs @@ -1,4 +1,4 @@ -using iNKORE.UI.WPF.Modern; +using Ink_Canvas.Helpers; using Microsoft.Win32; using System; using System.Timers; diff --git a/Ink Canvas/Windows/OobeWindow.xaml.cs b/Ink Canvas/Windows/OobeWindow.xaml.cs index 73df5fb4..23f63c08 100644 --- a/Ink Canvas/Windows/OobeWindow.xaml.cs +++ b/Ink Canvas/Windows/OobeWindow.xaml.cs @@ -5,7 +5,6 @@ using System.Windows.Controls; using System.Windows.Media; using System.Windows.Media.Animation; using FontIcon = iNKORE.UI.WPF.Modern.Controls.FontIcon; -using MessageBox = iNKORE.UI.WPF.Modern.Controls.MessageBox; using NavigationView = iNKORE.UI.WPF.Modern.Controls.NavigationView; using NavigationViewItem = iNKORE.UI.WPF.Modern.Controls.NavigationViewItem; using NavigationViewSelectionChangedEventArgs = iNKORE.UI.WPF.Modern.Controls.NavigationViewSelectionChangedEventArgs;