From 0fa401062508ea62df6eb29d81c89c3de6822e6b Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Sat, 18 Apr 2026 17:01:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/MainWindow.xaml.cs | 2 +- Ink Canvas/MainWindow_cs/MW_Colors.cs | 2 -- .../SettingsViews/MainWindowSettingsHelper.cs | 1 - .../Pages/AppearancePage.xaml.cs | 12 --------- .../SettingsViews/Pages/BasicPage.xaml.cs | 12 --------- .../SettingsViews/Pages/DesignPage.xaml.cs | 12 --------- .../SettingsViews/Pages/HomePage.xaml.cs | 12 --------- .../SettingsViews/Pages/Page2Page.xaml.cs | 13 --------- .../SettingsViews/SettingsWindow.xaml.cs | 27 +++++++++---------- 9 files changed, 14 insertions(+), 79 deletions(-) diff --git a/Ink Canvas/MainWindow.xaml.cs b/Ink Canvas/MainWindow.xaml.cs index af1e63d1..15174148 100644 --- a/Ink Canvas/MainWindow.xaml.cs +++ b/Ink Canvas/MainWindow.xaml.cs @@ -2822,7 +2822,7 @@ namespace Ink_Canvas settingsWindow.ShowDialog(); } } - + #endregion 新设置窗口 // 在MainWindow类中添加: diff --git a/Ink Canvas/MainWindow_cs/MW_Colors.cs b/Ink Canvas/MainWindow_cs/MW_Colors.cs index c3b444e4..320cab75 100644 --- a/Ink Canvas/MainWindow_cs/MW_Colors.cs +++ b/Ink Canvas/MainWindow_cs/MW_Colors.cs @@ -1,13 +1,11 @@ using Ink_Canvas.Helpers; using System; using System.Collections.Generic; -using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; -using System.Windows.Media.Animation; using System.Windows.Media.Imaging; namespace Ink_Canvas diff --git a/Ink Canvas/Windows/SettingsViews/MainWindowSettingsHelper.cs b/Ink Canvas/Windows/SettingsViews/MainWindowSettingsHelper.cs index 214454bc..44500cff 100644 --- a/Ink Canvas/Windows/SettingsViews/MainWindowSettingsHelper.cs +++ b/Ink Canvas/Windows/SettingsViews/MainWindowSettingsHelper.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Windows; diff --git a/Ink Canvas/Windows/SettingsViews/Pages/AppearancePage.xaml.cs b/Ink Canvas/Windows/SettingsViews/Pages/AppearancePage.xaml.cs index 8999b7df..1e36520a 100644 --- a/Ink Canvas/Windows/SettingsViews/Pages/AppearancePage.xaml.cs +++ b/Ink Canvas/Windows/SettingsViews/Pages/AppearancePage.xaml.cs @@ -1,17 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; namespace Ink_Canvas.Windows.SettingsViews.Pages { diff --git a/Ink Canvas/Windows/SettingsViews/Pages/BasicPage.xaml.cs b/Ink Canvas/Windows/SettingsViews/Pages/BasicPage.xaml.cs index 78b6e71b..f70e13b1 100644 --- a/Ink Canvas/Windows/SettingsViews/Pages/BasicPage.xaml.cs +++ b/Ink Canvas/Windows/SettingsViews/Pages/BasicPage.xaml.cs @@ -1,17 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; namespace Ink_Canvas.Windows.SettingsViews.Pages { diff --git a/Ink Canvas/Windows/SettingsViews/Pages/DesignPage.xaml.cs b/Ink Canvas/Windows/SettingsViews/Pages/DesignPage.xaml.cs index 41c804f5..01d5e7c8 100644 --- a/Ink Canvas/Windows/SettingsViews/Pages/DesignPage.xaml.cs +++ b/Ink Canvas/Windows/SettingsViews/Pages/DesignPage.xaml.cs @@ -1,17 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; namespace Ink_Canvas.Windows.SettingsViews.Pages { diff --git a/Ink Canvas/Windows/SettingsViews/Pages/HomePage.xaml.cs b/Ink Canvas/Windows/SettingsViews/Pages/HomePage.xaml.cs index 6ac88f06..a0052272 100644 --- a/Ink Canvas/Windows/SettingsViews/Pages/HomePage.xaml.cs +++ b/Ink Canvas/Windows/SettingsViews/Pages/HomePage.xaml.cs @@ -1,17 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; namespace Ink_Canvas.Windows.SettingsViews.Pages { diff --git a/Ink Canvas/Windows/SettingsViews/Pages/Page2Page.xaml.cs b/Ink Canvas/Windows/SettingsViews/Pages/Page2Page.xaml.cs index 26803bb3..d221d279 100644 --- a/Ink Canvas/Windows/SettingsViews/Pages/Page2Page.xaml.cs +++ b/Ink Canvas/Windows/SettingsViews/Pages/Page2Page.xaml.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; namespace Ink_Canvas.Windows.SettingsViews.Pages { diff --git a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs index a4b260b5..c13267e0 100644 --- a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs +++ b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs @@ -2,11 +2,10 @@ using Ink_Canvas.Windows.SettingsViews.Pages; using iNKORE.UI.WPF.Modern.Controls; using System; using System.Collections.Generic; -using System.Windows; -using System.Windows.Navigation; -using System.Windows.Interop; -using System.Windows.Input; using System.Linq; +using System.Windows; +using System.Windows.Interop; +using System.Windows.Navigation; using MessageBox = System.Windows.MessageBox; using Screen = System.Windows.Forms.Screen; @@ -16,13 +15,13 @@ namespace Ink_Canvas.Windows.SettingsViews { private readonly Dictionary _pageTypes; private readonly Dictionary _pages = new Dictionary(); - + // 保存窗口原始位置和大小 private double _originalLeft; private double _originalTop; private double _originalWidth; private double _originalHeight; - + // 标记窗口是否曾经最大化过 private bool _wasMaximized = false; @@ -89,10 +88,10 @@ namespace Ink_Canvas.Windows.SettingsViews _originalTop = this.Top; _originalWidth = this.Width; _originalHeight = this.Height; - + // 标记窗口曾经最大化过 _wasMaximized = true; - + // 最大化时清除最大尺寸限制 this.MaxWidth = double.PositiveInfinity; this.MaxHeight = double.PositiveInfinity; @@ -104,10 +103,10 @@ namespace Ink_Canvas.Windows.SettingsViews this.Top = _originalTop; this.Width = _originalWidth; this.Height = _originalHeight; - + // 重置标记 _wasMaximized = false; - + // 只设置最大尺寸,不改变窗口位置 SetMaxSizeOnly(); } @@ -116,11 +115,11 @@ namespace Ink_Canvas.Windows.SettingsViews // 正常状态下只设置最大尺寸限制 SetMaxSizeOnly(); } - + // 窗口状态改变时更新标题栏显示 UpdateAppTitleBarMargin(); }; - + // 窗口大小改变时更新标题栏显示 this.SizeChanged += (sender, e) => { @@ -158,7 +157,7 @@ namespace Ink_Canvas.Windows.SettingsViews #endregion #region 高DPI/多屏自适应窗口控制 - + /// /// 获取当前窗口所在屏幕的工作区尺寸(DIP单位) /// @@ -341,7 +340,7 @@ namespace Ink_Canvas.Windows.SettingsViews if (sender.DisplayMode == NavigationViewDisplayMode.Minimal) { AppTitleBar.Margin = new Thickness((sender.CompactPaneLength * 2), currMargin.Top, currMargin.Right, currMargin.Bottom); - + // 当窗口宽度非常小时,隐藏图标和应用设置文字 if (this.ActualWidth < 400) {