refactor(设置): 重构设置窗口为独立窗口并移除旧设置面板
移除旧的内置设置面板及相关代码,将设置功能迁移至独立的设置窗口 优化设置窗口的主题同步功能,调整自动化页面布局
This commit is contained in:
@@ -33,6 +33,8 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
ApplyCurrentTheme();
|
||||
|
||||
// 初始化内置页面映射
|
||||
_pageTypes = new Dictionary<string, Type>
|
||||
{
|
||||
@@ -124,6 +126,27 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
};
|
||||
}
|
||||
|
||||
public void RefreshTheme()
|
||||
{
|
||||
ApplyCurrentTheme();
|
||||
}
|
||||
|
||||
private void ApplyCurrentTheme()
|
||||
{
|
||||
try
|
||||
{
|
||||
int themeIndex = Helpers.SettingsManager.Settings.Appearance.Theme;
|
||||
var elementTheme = themeIndex switch
|
||||
{
|
||||
0 => iNKORE.UI.WPF.Modern.ElementTheme.Light,
|
||||
1 => iNKORE.UI.WPF.Modern.ElementTheme.Dark,
|
||||
_ => iNKORE.UI.WPF.Modern.ElementTheme.Default,
|
||||
};
|
||||
iNKORE.UI.WPF.Modern.ThemeManager.SetRequestedTheme(this, elementTheme);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
#region 修复触摸屏鼠标指针消失问题
|
||||
|
||||
[System.Runtime.InteropServices.DllImport("user32.dll")]
|
||||
|
||||
Reference in New Issue
Block a user