mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Rename methods to make their purpose more obvious; slight code style changes
This commit is contained in:
parent
465108a9d4
commit
67be335600
2 changed files with 12 additions and 14 deletions
|
|
@ -66,7 +66,7 @@ namespace Flow.Launcher.Infrastructure
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="window"></param>
|
||||
/// <param name="cornerType">DoNotRound, Round, RoundSmall, Default</param>
|
||||
|
|
@ -362,7 +362,7 @@ namespace Flow.Launcher.Infrastructure
|
|||
return HKL.Null;
|
||||
}
|
||||
|
||||
public static unsafe void SetEnglishKeyboardLayout(bool backupPrevious)
|
||||
public static unsafe void SwitchToEnglishKeyboardLayout(bool backupPrevious)
|
||||
{
|
||||
// Find an installed English layout
|
||||
var enHKL = FindEnglishKeyboardLayout();
|
||||
|
|
@ -384,14 +384,12 @@ namespace Flow.Launcher.Infrastructure
|
|||
PInvoke.ActivateKeyboardLayout(enHKL, 0);
|
||||
}
|
||||
|
||||
public static void SetPreviousKeyboardLayout()
|
||||
public static void RestorePreviousKeyboardLayout()
|
||||
{
|
||||
if (_previousLayout != HKL.Null)
|
||||
{
|
||||
PInvoke.ActivateKeyboardLayout(_previousLayout, 0);
|
||||
if (_previousLayout == HKL.Null) return;
|
||||
|
||||
_previousLayout = HKL.Null;
|
||||
}
|
||||
PInvoke.ActivateKeyboardLayout(_previousLayout, 0);
|
||||
_previousLayout = HKL.Null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
|
|
@ -1376,7 +1376,7 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
if (StartWithEnglishMode)
|
||||
{
|
||||
Win32Helper.SetEnglishKeyboardLayout(true);
|
||||
Win32Helper.SwitchToEnglishKeyboardLayout(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -1385,6 +1385,11 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
public async void Hide()
|
||||
{
|
||||
|
||||
if (StartWithEnglishMode)
|
||||
{
|
||||
Win32Helper.RestorePreviousKeyboardLayout();
|
||||
}
|
||||
lastHistoryIndex = 1;
|
||||
|
||||
if (ExternalPreviewVisible)
|
||||
|
|
@ -1447,11 +1452,6 @@ namespace Flow.Launcher.ViewModel
|
|||
Win32Helper.DWMSetCloakForWindow(mainWindow, true);
|
||||
}
|
||||
|
||||
if (StartWithEnglishMode)
|
||||
{
|
||||
Win32Helper.SetPreviousKeyboardLayout();
|
||||
}
|
||||
|
||||
await Task.Delay(50);
|
||||
|
||||
// Update WPF properties
|
||||
|
|
|
|||
Loading…
Reference in a new issue