feat(设置): 新增墨迹纠正设置页面并重构设置界面
重构设置界面,将墨迹纠正相关功能从画板设置中分离出来,新增独立的墨迹纠正设置页面。主要变更包括: - 新增 InkRecognitionPage 用于集中管理墨迹纠正功能 - 调整设置窗口导航结构,将墨迹纠正设为画板设置的子页面 - 优化设置项布局,使用折叠面板组织复杂选项 - 移除主窗口中冗余的崩溃处理和手势设置 - 修复多指手势时橡皮擦状态保存问题 - 新增笔尖模式相关字符串资源
This commit is contained in:
@@ -3,6 +3,7 @@ using Ink_Canvas.Windows.SettingsViews.Helpers;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
{
|
||||
@@ -44,6 +45,20 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
}
|
||||
|
||||
CardExternalProtocol.IsOn = settings.Advanced.IsEnableUriScheme;
|
||||
|
||||
if (settings.Startup != null)
|
||||
{
|
||||
CardEnableNibMode.IsOn = settings.Startup.IsEnableNibMode;
|
||||
|
||||
if (settings.Startup.CrashAction == 0)
|
||||
{
|
||||
RadioCrashSilentRestart.IsChecked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
RadioCrashNoAction.IsChecked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -151,6 +166,70 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
|
||||
#endregion
|
||||
|
||||
#region 笔尖模式事件处理
|
||||
|
||||
private void ToggleSwitchEnableNibMode_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
|
||||
try
|
||||
{
|
||||
bool newState = CardEnableNibMode.IsOn;
|
||||
SettingsManager.Settings.Startup.IsEnableNibMode = newState;
|
||||
|
||||
var window = Application.Current.MainWindow;
|
||||
if (window is MainWindow mw)
|
||||
{
|
||||
if (mw.ToggleSwitchEnableNibMode != null)
|
||||
mw.ToggleSwitchEnableNibMode.IsOn = newState;
|
||||
if (mw.BoardToggleSwitchEnableNibMode != null)
|
||||
mw.BoardToggleSwitchEnableNibMode.IsOn = newState;
|
||||
|
||||
if (newState)
|
||||
mw.BoundsWidth = SettingsManager.Settings.Advanced.NibModeBoundsWidth;
|
||||
else
|
||||
mw.BoundsWidth = SettingsManager.Settings.Advanced.FingerModeBoundsWidth;
|
||||
}
|
||||
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"设置笔尖模式时出错: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 崩溃后操作事件处理
|
||||
|
||||
private void RadioCrashAction_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
|
||||
try
|
||||
{
|
||||
if (RadioCrashSilentRestart != null && RadioCrashSilentRestart.IsChecked == true)
|
||||
{
|
||||
App.CrashAction = App.CrashActionType.SilentRestart;
|
||||
SettingsManager.Settings.Startup.CrashAction = 0;
|
||||
}
|
||||
else if (RadioCrashNoAction != null && RadioCrashNoAction.IsChecked == true)
|
||||
{
|
||||
App.CrashAction = App.CrashActionType.NoAction;
|
||||
SettingsManager.Settings.Startup.CrashAction = 1;
|
||||
}
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
App.SyncCrashActionFromSettings();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"设置崩溃操作时出错: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 模式设置事件处理
|
||||
|
||||
private void ToggleSwitchPPTOnlyMode_Toggled(object sender, RoutedEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user