add:新设置

This commit is contained in:
PrefacedCorg
2026-04-23 06:48:52 +08:00
parent 259ce3dd11
commit b949b1651a
24 changed files with 1838 additions and 3526 deletions
@@ -69,6 +69,16 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
if (settings.Startup != null)
{
CardFoldAtStartup.IsOn = settings.Startup.IsFoldAtStartup;
CardEnableNibMode.IsOn = settings.Startup.IsEnableNibMode;
if (settings.Startup.CrashAction == 0)
{
RadioCrashSilentRestart.IsChecked = true;
}
else
{
RadioCrashNoAction.IsChecked = true;
}
}
if (settings.ModeSettings != null)
@@ -309,6 +319,49 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
}
}
private void ToggleSwitchEnableNibMode_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
try
{
bool newState = CardEnableNibMode.IsOn;
SettingsManager.Settings.Startup.IsEnableNibMode = newState;
SettingsManager.SaveSettingsToFile();
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableNibMode", newState);
}
catch (Exception ex)
{
Debug.WriteLine($"设置笔尖模式时出错: {ex.Message}");
}
}
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