Merge branch 'net6' of https://github.com/InkCanvasForClass/community into net6
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using iNKORE.UI.WPF.Modern;
|
||||
using Ink_Canvas.Helpers;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -246,27 +247,11 @@ namespace Ink_Canvas
|
||||
SetTheme(ThemeDark);
|
||||
break;
|
||||
case 2:
|
||||
SetTheme(IsSystemThemeLight() ? ThemeLight : ThemeDark);
|
||||
SetTheme(ThemeHelper.IsSystemThemeLightLegacy() ? ThemeLight : ThemeDark);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsSystemThemeLight()
|
||||
{
|
||||
try
|
||||
{
|
||||
var registryKey = Registry.CurrentUser;
|
||||
var themeKey = registryKey.OpenSubKey("software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize");
|
||||
if (themeKey != null)
|
||||
{
|
||||
int keyValue = (int)themeKey.GetValue("SystemUsesLightTheme");
|
||||
return keyValue == 1;
|
||||
}
|
||||
}
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
return false;
|
||||
}
|
||||
|
||||
private void AutoSwitchFloatingBarIconForTheme(string theme)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user