improve:UI
This commit is contained in:
@@ -303,7 +303,7 @@ namespace Ink_Canvas
|
|||||||
[JsonProperty("isShowModeFingerToggleSwitch")]
|
[JsonProperty("isShowModeFingerToggleSwitch")]
|
||||||
public bool IsShowModeFingerToggleSwitch { get; set; } = true;
|
public bool IsShowModeFingerToggleSwitch { get; set; } = true;
|
||||||
[JsonProperty("theme")]
|
[JsonProperty("theme")]
|
||||||
public int Theme { get; set; }
|
public int Theme { get; set; } = 2;
|
||||||
|
|
||||||
// 浮动栏按钮显示控制
|
// 浮动栏按钮显示控制
|
||||||
[JsonProperty("useLegacyFloatingBarUI")]
|
[JsonProperty("useLegacyFloatingBarUI")]
|
||||||
|
|||||||
@@ -141,13 +141,27 @@ namespace Ink_Canvas.Windows.SettingsViews
|
|||||||
{
|
{
|
||||||
0 => iNKORE.UI.WPF.Modern.ElementTheme.Light,
|
0 => iNKORE.UI.WPF.Modern.ElementTheme.Light,
|
||||||
1 => iNKORE.UI.WPF.Modern.ElementTheme.Dark,
|
1 => iNKORE.UI.WPF.Modern.ElementTheme.Dark,
|
||||||
_ => iNKORE.UI.WPF.Modern.ElementTheme.Default,
|
_ => IsSystemThemeLight() ? iNKORE.UI.WPF.Modern.ElementTheme.Light : iNKORE.UI.WPF.Modern.ElementTheme.Dark,
|
||||||
};
|
};
|
||||||
iNKORE.UI.WPF.Modern.ThemeManager.SetRequestedTheme(this, elementTheme);
|
iNKORE.UI.WPF.Modern.ThemeManager.SetRequestedTheme(this, elementTheme);
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool IsSystemThemeLight()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (var themeKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(
|
||||||
|
@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"))
|
||||||
|
{
|
||||||
|
if (themeKey?.GetValue("SystemUsesLightTheme") is int v) return v == 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
#region 修复触摸屏鼠标指针消失问题
|
#region 修复触摸屏鼠标指针消失问题
|
||||||
|
|
||||||
[System.Runtime.InteropServices.DllImport("user32.dll")]
|
[System.Runtime.InteropServices.DllImport("user32.dll")]
|
||||||
|
|||||||
Reference in New Issue
Block a user