feat(设置): 新增个性化设置页面并重构主题相关功能

重构主题和语言设置功能,将相关代码从主窗口迁移至新增的个性化设置页面
优化浮动工具栏图标选择逻辑,移除冗余代码
统一设置页面中开关控件的样式和行为
修复设置页面导航项的选择状态问题
This commit is contained in:
PrefacedCorg
2026-04-25 17:00:02 +08:00
parent b1640f44c2
commit ef5377f85c
23 changed files with 1009 additions and 1488 deletions
@@ -50,14 +50,7 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
{
CardEnableNibMode.IsOn = settings.Startup.IsEnableNibMode;
if (settings.Startup.CrashAction == 0)
{
RadioCrashSilentRestart.IsChecked = true;
}
else
{
RadioCrashNoAction.IsChecked = true;
}
ComboBoxCrashAction.SelectedIndex = settings.Startup.CrashAction;
}
}
catch (Exception ex)
@@ -203,21 +196,25 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
#region
private void RadioCrashAction_Checked(object sender, RoutedEventArgs e)
private void ComboBoxCrashAction_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (!_isLoaded) return;
try
{
if (RadioCrashSilentRestart != null && RadioCrashSilentRestart.IsChecked == true)
var item = ComboBoxCrashAction?.SelectedItem as ComboBoxItem;
if (item == null) return;
var tag = item.Tag?.ToString() ?? "0";
switch (tag)
{
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;
case "0":
App.CrashAction = App.CrashActionType.SilentRestart;
SettingsManager.Settings.Startup.CrashAction = 0;
break;
case "1":
App.CrashAction = App.CrashActionType.NoAction;
SettingsManager.Settings.Startup.CrashAction = 1;
break;
}
SettingsManager.SaveSettingsToFile();
App.SyncCrashActionFromSettings();