mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Code quality
This commit is contained in:
parent
218635a035
commit
a6c7430094
2 changed files with 11 additions and 9 deletions
|
|
@ -21,10 +21,6 @@ namespace Flow.Launcher.Infrastructure
|
|||
{
|
||||
#region Blur Handling
|
||||
|
||||
public static bool IsWindows11()
|
||||
{
|
||||
return Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build >= 22000;
|
||||
}
|
||||
public static bool IsBackdropSupported()
|
||||
{
|
||||
// Mica and Acrylic only supported Windows 11 22000+
|
||||
|
|
@ -525,6 +521,12 @@ namespace Flow.Launcher.Infrastructure
|
|||
|
||||
#region Korean IME
|
||||
|
||||
public static bool IsWindows11()
|
||||
{
|
||||
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows) &&
|
||||
Environment.OSVersion.Version.Build >= 22000;
|
||||
}
|
||||
|
||||
public static bool IsKoreanIMEExist()
|
||||
{
|
||||
return GetLegacyKoreanIMERegistryValue() != null;
|
||||
|
|
|
|||
|
|
@ -210,9 +210,9 @@ public partial class SettingsPaneGeneralViewModel : BaseModel
|
|||
{
|
||||
get
|
||||
{
|
||||
bool registryKeyExists = Win32Helper.IsKoreanIMEExist();
|
||||
bool koreanLanguageInstalled = InputLanguage.InstalledInputLanguages.Cast<InputLanguage>().Any(lang => lang.Culture.Name.StartsWith("ko"));
|
||||
bool isWindows11 = Win32Helper.IsWindows11();
|
||||
var registryKeyExists = Win32Helper.IsKoreanIMEExist();
|
||||
var koreanLanguageInstalled = InputLanguage.InstalledInputLanguages.Cast<InputLanguage>().Any(lang => lang.Culture.Name.StartsWith("ko"));
|
||||
var isWindows11 = Win32Helper.IsWindows11();
|
||||
|
||||
// Return true if Windows 11 with Korean IME installed, or if the registry key exists
|
||||
return (isWindows11 && koreanLanguageInstalled) || registryKeyExists;
|
||||
|
|
@ -223,12 +223,12 @@ public partial class SettingsPaneGeneralViewModel : BaseModel
|
|||
{
|
||||
get
|
||||
{
|
||||
object value = Win32Helper.GetLegacyKoreanIMERegistryValue();
|
||||
var value = Win32Helper.GetLegacyKoreanIMERegistryValue();
|
||||
if (value is int intValue)
|
||||
{
|
||||
return intValue == 0;
|
||||
}
|
||||
else if (value != null && int.TryParse(value.ToString(), out int parsedValue))
|
||||
else if (value != null && int.TryParse(value.ToString(), out var parsedValue))
|
||||
{
|
||||
return parsedValue == 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue