From bcbece5bd6d7533e77bac791a4b04acb1260d397 Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Sun, 5 Apr 2026 21:50:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=9B=B4=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/MainWindow.xaml.cs | 2 +- .../MainWindowSettingsHelper.cs | 8 ++++---- .../Pages/AboutPage.xaml | 2 +- .../Pages/AboutPage.xaml.cs | 2 +- .../Pages/AppearancePage.xaml | 4 ++-- .../Pages/AppearancePage.xaml.cs | 8 ++++---- .../Pages/BasicPage.xaml | 4 ++-- .../Pages/BasicPage.xaml.cs | 6 +++--- .../Pages/ColorsPage.xaml | 2 +- .../Pages/ColorsPage.xaml.cs | 2 +- .../Pages/DesignPage.xaml | 4 ++-- .../Pages/DesignPage.xaml.cs | 6 +++--- .../Pages/FontsPage.xaml | 2 +- .../Pages/FontsPage.xaml.cs | 2 +- .../Pages/HomePage.xaml | 4 ++-- .../Pages/HomePage.xaml.cs | 18 +++++++++--------- .../Pages/IconographyPage.xaml | 2 +- .../Pages/IconographyPage.xaml.cs | 2 +- .../Pages/Page2Page.xaml | 4 ++-- .../Pages/Page2Page.xaml.cs | 2 +- .../Pages/SettingsPage.xaml | 2 +- .../Pages/SettingsPage.xaml.cs | 2 +- .../Pages/StartupPage.xaml | 4 ++-- .../Pages/StartupPage.xaml.cs | 16 ++++++++-------- .../Pages/ThemePage.xaml | 2 +- .../Pages/ThemePage.xaml.cs | 2 +- .../Pages/TypographyPage.xaml | 2 +- .../Pages/TypographyPage.xaml.cs | 2 +- .../SettingsWindow.xaml} | 2 +- .../SettingsWindow.xaml.cs} | 8 ++++---- 30 files changed, 64 insertions(+), 64 deletions(-) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/MainWindowSettingsHelper.cs (99%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/AboutPage.xaml (92%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/AboutPage.xaml.cs (77%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/AppearancePage.xaml (96%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/AppearancePage.xaml.cs (79%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/BasicPage.xaml (96%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/BasicPage.xaml.cs (83%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/ColorsPage.xaml (91%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/ColorsPage.xaml.cs (78%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/DesignPage.xaml (95%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/DesignPage.xaml.cs (81%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/FontsPage.xaml (92%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/FontsPage.xaml.cs (77%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/HomePage.xaml (97%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/HomePage.xaml.cs (75%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/IconographyPage.xaml (96%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/IconographyPage.xaml.cs (78%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/Page2Page.xaml (86%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/Page2Page.xaml.cs (92%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/SettingsPage.xaml (91%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/SettingsPage.xaml.cs (78%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/StartupPage.xaml (98%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/StartupPage.xaml.cs (88%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/ThemePage.xaml (92%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/ThemePage.xaml.cs (77%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/TypographyPage.xaml (91%) rename Ink Canvas/Windows/{SettingsViews2 => SettingsViews}/Pages/TypographyPage.xaml.cs (78%) rename Ink Canvas/Windows/{SettingsViews2/SettingsWindow2.xaml => SettingsViews/SettingsWindow.xaml} (99%) rename Ink Canvas/Windows/{SettingsViews2/SettingsWindow2.xaml.cs => SettingsViews/SettingsWindow.xaml.cs} (98%) diff --git a/Ink Canvas/MainWindow.xaml.cs b/Ink Canvas/MainWindow.xaml.cs index 4b5a2e7c..af1e63d1 100644 --- a/Ink Canvas/MainWindow.xaml.cs +++ b/Ink Canvas/MainWindow.xaml.cs @@ -2817,7 +2817,7 @@ namespace Ink_Canvas if (isOpeningOrHidingSettingsPane) return; HideSubPanels(); { - var settingsWindow = new Windows.SettingsViews2.SettingsWindow2(); + var settingsWindow = new Windows.SettingsViews.SettingsWindow(); settingsWindow.Owner = this; settingsWindow.ShowDialog(); } diff --git a/Ink Canvas/Windows/SettingsViews2/MainWindowSettingsHelper.cs b/Ink Canvas/Windows/SettingsViews/MainWindowSettingsHelper.cs similarity index 99% rename from Ink Canvas/Windows/SettingsViews2/MainWindowSettingsHelper.cs rename to Ink Canvas/Windows/SettingsViews/MainWindowSettingsHelper.cs index a05b5f0d..214454bc 100644 --- a/Ink Canvas/Windows/SettingsViews2/MainWindowSettingsHelper.cs +++ b/Ink Canvas/Windows/SettingsViews/MainWindowSettingsHelper.cs @@ -7,7 +7,7 @@ using System.Windows.Controls; using System.Windows.Input; using Media = System.Windows.Media; -namespace Ink_Canvas.Windows.SettingsViews2 +namespace Ink_Canvas.Windows.SettingsViews { public static class MainWindowSettingsHelper { @@ -331,7 +331,7 @@ namespace Ink_Canvas.Windows.SettingsViews2 // 查找所有打开的设置窗口 foreach (Window window in Application.Current.Windows) { - if (window.GetType().Name == "SettingsWindow2") + if (window.GetType().Name == "SettingsWindow") { // 同步所有面板(保守策略) SyncAllPanels(window); @@ -456,8 +456,8 @@ namespace Ink_Canvas.Windows.SettingsViews2 // 查找所有打开的设置窗口 foreach (Window window in Application.Current.Windows) { - // 使用类型名称匹配,因为 SettingsWindow2 在不同的命名空间中 - if (window.GetType().Name == "SettingsWindow2") + // 使用类型名称匹配,因为 SettingsWindow 在不同的命名空间中 + if (window.GetType().Name == "SettingsWindow") { // 同时调用 ApplyTheme 方法更新窗口本身 var applyThemeMethod = window.GetType().GetMethod("ApplyTheme", diff --git a/Ink Canvas/Windows/SettingsViews2/Pages/AboutPage.xaml b/Ink Canvas/Windows/SettingsViews/Pages/AboutPage.xaml similarity index 92% rename from Ink Canvas/Windows/SettingsViews2/Pages/AboutPage.xaml rename to Ink Canvas/Windows/SettingsViews/Pages/AboutPage.xaml index c828997d..89458f8a 100644 --- a/Ink Canvas/Windows/SettingsViews2/Pages/AboutPage.xaml +++ b/Ink Canvas/Windows/SettingsViews/Pages/AboutPage.xaml @@ -1,5 +1,5 @@ /// Basic.xaml 的交互逻辑 @@ -27,8 +27,8 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages private void SettingsCard_Click(object sender, RoutedEventArgs e) { - // 找到SettingsWindow2窗口 - SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2; + // 找到SettingsWindow窗口 + SettingsWindow settingsWindow = Window.GetWindow(this) as SettingsWindow; if (settingsWindow != null) { // 调用NavigateToPage方法导航到启动页面 diff --git a/Ink Canvas/Windows/SettingsViews2/Pages/ColorsPage.xaml b/Ink Canvas/Windows/SettingsViews/Pages/ColorsPage.xaml similarity index 91% rename from Ink Canvas/Windows/SettingsViews2/Pages/ColorsPage.xaml rename to Ink Canvas/Windows/SettingsViews/Pages/ColorsPage.xaml index b048d795..70dc2588 100644 --- a/Ink Canvas/Windows/SettingsViews2/Pages/ColorsPage.xaml +++ b/Ink Canvas/Windows/SettingsViews/Pages/ColorsPage.xaml @@ -1,5 +1,5 @@ /// HomePage.xaml 的交互逻辑 @@ -27,8 +27,8 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages private void SettingsCard_Basic_Click(object sender, RoutedEventArgs e) { - // 找到SettingsWindow2窗口 - SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2; + // 找到SettingsWindow窗口 + SettingsWindow settingsWindow = Window.GetWindow(this) as SettingsWindow; if (settingsWindow != null) { // 调用NavigateToPage方法导航到基本设置页面 @@ -38,8 +38,8 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages private void SettingsCard_Page2_Click(object sender, RoutedEventArgs e) { - // 找到SettingsWindow2窗口 - SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2; + // 找到SettingsWindow窗口 + SettingsWindow settingsWindow = Window.GetWindow(this) as SettingsWindow; if (settingsWindow != null) { // 调用NavigateToPage方法导航到页面2 @@ -49,8 +49,8 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages private void SettingsCard_Design_Click(object sender, RoutedEventArgs e) { - // 找到SettingsWindow2窗口 - SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2; + // 找到SettingsWindow窗口 + SettingsWindow settingsWindow = Window.GetWindow(this) as SettingsWindow; if (settingsWindow != null) { // 调用NavigateToPage方法导航到设计设置页面 @@ -60,8 +60,8 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages private void SettingsCard_Appearance_Click(object sender, RoutedEventArgs e) { - // 找到SettingsWindow2窗口 - SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2; + // 找到SettingsWindow窗口 + SettingsWindow settingsWindow = Window.GetWindow(this) as SettingsWindow; if (settingsWindow != null) { // 调用NavigateToPage方法导航到外观设置页面 diff --git a/Ink Canvas/Windows/SettingsViews2/Pages/IconographyPage.xaml b/Ink Canvas/Windows/SettingsViews/Pages/IconographyPage.xaml similarity index 96% rename from Ink Canvas/Windows/SettingsViews2/Pages/IconographyPage.xaml rename to Ink Canvas/Windows/SettingsViews/Pages/IconographyPage.xaml index b2499cce..6f3fabee 100644 --- a/Ink Canvas/Windows/SettingsViews2/Pages/IconographyPage.xaml +++ b/Ink Canvas/Windows/SettingsViews/Pages/IconographyPage.xaml @@ -1,5 +1,5 @@ diff --git a/Ink Canvas/Windows/SettingsViews2/Pages/Page2Page.xaml.cs b/Ink Canvas/Windows/SettingsViews/Pages/Page2Page.xaml.cs similarity index 92% rename from Ink Canvas/Windows/SettingsViews2/Pages/Page2Page.xaml.cs rename to Ink Canvas/Windows/SettingsViews/Pages/Page2Page.xaml.cs index 2a49db6e..26803bb3 100644 --- a/Ink Canvas/Windows/SettingsViews2/Pages/Page2Page.xaml.cs +++ b/Ink Canvas/Windows/SettingsViews/Pages/Page2Page.xaml.cs @@ -13,7 +13,7 @@ using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; -namespace Ink_Canvas.Windows.SettingsViews2.Pages +namespace Ink_Canvas.Windows.SettingsViews.Pages { /// /// Page2.xaml 的交互逻辑 diff --git a/Ink Canvas/Windows/SettingsViews2/Pages/SettingsPage.xaml b/Ink Canvas/Windows/SettingsViews/Pages/SettingsPage.xaml similarity index 91% rename from Ink Canvas/Windows/SettingsViews2/Pages/SettingsPage.xaml rename to Ink Canvas/Windows/SettingsViews/Pages/SettingsPage.xaml index 9e0a1d74..01a9c046 100644 --- a/Ink Canvas/Windows/SettingsViews2/Pages/SettingsPage.xaml +++ b/Ink Canvas/Windows/SettingsViews/Pages/SettingsPage.xaml @@ -1,5 +1,5 @@ /// StartupPage.xaml 的交互逻辑 @@ -97,7 +97,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages bool newState = ToggleSwitchNoFocusMode.IsOn; // 使用Helper类更新设置并应用 - Windows.SettingsViews2.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchNoFocusMode", newState); + Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchNoFocusMode", newState); } catch (Exception ex) { @@ -117,7 +117,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages bool newState = ToggleSwitchWindowMode.IsOn; // 使用Helper类更新设置并应用 - Windows.SettingsViews2.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchWindowMode", newState); + Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchWindowMode", newState); } catch (Exception ex) { @@ -137,7 +137,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages bool newState = ToggleSwitchAlwaysOnTop.IsOn; // 使用Helper类更新设置并应用 - Windows.SettingsViews2.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAlwaysOnTop", newState); + Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAlwaysOnTop", newState); } catch (Exception ex) { @@ -166,7 +166,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages MainWindow.SaveSettingsToFile(); // 通知其他面板同步状态 - Windows.SettingsViews2.MainWindowSettingsHelper.NotifySettingsPanelsSyncState("ToggleSwitchUIAccessTopMost"); + Windows.SettingsViews.MainWindowSettingsHelper.NotifySettingsPanelsSyncState("ToggleSwitchUIAccessTopMost"); } catch (Exception ex) { @@ -190,7 +190,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages bool newState = ToggleSwitchRunAtStartup.IsOn; // 使用Helper类更新设置并应用 - Windows.SettingsViews2.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchRunAtStartup", newState); + Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchRunAtStartup", newState); } catch (Exception ex) { @@ -210,7 +210,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages bool newState = ToggleSwitchFoldAtStartup.IsOn; // 使用Helper类更新设置并应用 - Windows.SettingsViews2.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchFoldAtStartup", newState); + Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchFoldAtStartup", newState); } catch (Exception ex) { @@ -234,7 +234,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages bool newState = ToggleSwitchPPTOnlyMode.IsOn; // 使用Helper类更新设置并应用 - Windows.SettingsViews2.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchMode", newState); + Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchMode", newState); } catch (Exception ex) { diff --git a/Ink Canvas/Windows/SettingsViews2/Pages/ThemePage.xaml b/Ink Canvas/Windows/SettingsViews/Pages/ThemePage.xaml similarity index 92% rename from Ink Canvas/Windows/SettingsViews2/Pages/ThemePage.xaml rename to Ink Canvas/Windows/SettingsViews/Pages/ThemePage.xaml index 6a42b271..7ba46eab 100644 --- a/Ink Canvas/Windows/SettingsViews2/Pages/ThemePage.xaml +++ b/Ink Canvas/Windows/SettingsViews/Pages/ThemePage.xaml @@ -1,5 +1,5 @@ _pageTypes; private readonly Dictionary _pages = new Dictionary(); @@ -26,7 +26,7 @@ namespace Ink_Canvas.Windows.SettingsViews2 // 标记窗口是否曾经最大化过 private bool _wasMaximized = false; - public SettingsWindow2() + public SettingsWindow() { InitializeComponent(); From 057fb35d00f7285140edf3fb7b896f0a1e35c7ca Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Sun, 5 Apr 2026 22:03:16 +0800 Subject: [PATCH 2/2] improve:UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 快捷键设置UI改进 --- Ink Canvas/Windows/HotkeyItem.xaml | 106 ++-- Ink Canvas/Windows/HotkeyItem.xaml.cs | 16 +- Ink Canvas/Windows/HotkeySettingsWindow.xaml | 546 +++++++++++------- .../Windows/HotkeySettingsWindow.xaml.cs | 5 - 4 files changed, 418 insertions(+), 255 deletions(-) diff --git a/Ink Canvas/Windows/HotkeyItem.xaml b/Ink Canvas/Windows/HotkeyItem.xaml index 0f2ff92a..3cfc5b1e 100644 --- a/Ink Canvas/Windows/HotkeyItem.xaml +++ b/Ink Canvas/Windows/HotkeyItem.xaml @@ -1,66 +1,70 @@ - - - + mc:Ignorable="d" + d:DesignHeight="60" + d:DesignWidth="600"> + + + - - - + + + - - - + + - - - + + - - public partial class HotkeyItem : UserControl { + private static readonly SolidColorBrush HotkeyValueForeground = CreateFrozenBrush(0xFA, 0xFA, 0xFA); + private static readonly SolidColorBrush HotkeyPlaceholderForeground = CreateFrozenBrush(0xA1, 0xA1, 0xAA); + + private static SolidColorBrush CreateFrozenBrush(byte r, byte g, byte b) + { + var brush = new SolidColorBrush(Color.FromRgb(r, g, b)); + brush.Freeze(); + return brush; + } + #region Events /// /// 快捷键变更事件 @@ -80,13 +90,13 @@ namespace Ink_Canvas.Windows if (_currentKey == Key.None) { CurrentHotkeyTextBlock.Text = "未设置"; - CurrentHotkeyTextBlock.Foreground = Brushes.Gray; + CurrentHotkeyTextBlock.Foreground = HotkeyPlaceholderForeground; } else { var modifiersText = _currentModifiers == ModifierKeys.None ? "" : $"{_currentModifiers}+"; CurrentHotkeyTextBlock.Text = $"{modifiersText}{_currentKey}"; - CurrentHotkeyTextBlock.Foreground = Brushes.Black; + CurrentHotkeyTextBlock.Foreground = HotkeyValueForeground; } } @@ -106,7 +116,7 @@ namespace Ink_Canvas.Windows private void StopHotkeyCapture() { BtnSetHotkey.Content = "设置"; - BtnSetHotkey.Background = Brushes.DodgerBlue; + BtnSetHotkey.ClearValue(Button.BackgroundProperty); // 移除键盘事件处理器 KeyDown -= HotkeyItem_KeyDown; diff --git a/Ink Canvas/Windows/HotkeySettingsWindow.xaml b/Ink Canvas/Windows/HotkeySettingsWindow.xaml index 249de7b1..18d6518e 100644 --- a/Ink Canvas/Windows/HotkeySettingsWindow.xaml +++ b/Ink Canvas/Windows/HotkeySettingsWindow.xaml @@ -6,216 +6,370 @@ xmlns:local="clr-namespace:Ink_Canvas.Windows" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf" - ui:ThemeManager.RequestedTheme="Light" - Background="#F9F9F9" - AllowsTransparency="True" - mc:Ignorable="d" - WindowStyle="None" + mc:Ignorable="d" + Title="快捷键设置" + Height="600" + Width="800" WindowStartupLocation="CenterScreen" ResizeMode="CanResize" - Title="快捷键设置" - Height="600" - Width="800"> - + FontFamily="Microsoft YaHei UI" + ui:ThemeManager.IsThemeAware="True" + ui:TitleBar.ExtendViewIntoTitleBar="True" + ui:WindowHelper.SystemBackdropType="Mica" + ui:WindowHelper.UseModernWindowStyle="True" + ui:TitleBar.Height="48"> + + + + + + + + + + + + + + + + - - - + + + - - - + - - - -