mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
add last query mode update to SetCustomPluginHotkey
This commit is contained in:
parent
04d959c4ba
commit
b96a02bd60
1 changed files with 25 additions and 17 deletions
|
|
@ -57,22 +57,7 @@ namespace Flow.Launcher.Helper
|
|||
{
|
||||
if (!ShouldIgnoreHotkeys())
|
||||
{
|
||||
if (settings.LastQueryMode == LastQueryMode.Empty)
|
||||
{
|
||||
mainViewModel.ChangeQueryText(string.Empty);
|
||||
}
|
||||
else if (settings.LastQueryMode == LastQueryMode.Preserved)
|
||||
{
|
||||
mainViewModel.LastQuerySelected = true;
|
||||
}
|
||||
else if (settings.LastQueryMode == LastQueryMode.Selected)
|
||||
{
|
||||
mainViewModel.LastQuerySelected = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException($"wrong LastQueryMode: <{settings.LastQueryMode}>");
|
||||
}
|
||||
UpdateLastQUeryMode();
|
||||
|
||||
mainViewModel.ToggleFlowLauncher();
|
||||
e.Handled = true;
|
||||
|
|
@ -87,6 +72,25 @@ namespace Flow.Launcher.Helper
|
|||
return settings.IgnoreHotkeysOnFullscreen && WindowsInteropHelper.IsWindowFullscreen();
|
||||
}
|
||||
|
||||
private static void UpdateLastQUeryMode()
|
||||
{
|
||||
switch(settings.LastQueryMode)
|
||||
{
|
||||
case LastQueryMode.Empty:
|
||||
mainViewModel.ChangeQueryText(string.Empty);
|
||||
break;
|
||||
case LastQueryMode.Preserved:
|
||||
mainViewModel.LastQuerySelected = true;
|
||||
break;
|
||||
case LastQueryMode.Selected:
|
||||
mainViewModel.LastQuerySelected = false;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentException($"wrong LastQueryMode: <{settings.LastQueryMode}>");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetCustomPluginHotkey()
|
||||
{
|
||||
if (settings.CustomPluginHotkeys == null) return;
|
||||
|
|
@ -94,7 +98,11 @@ namespace Flow.Launcher.Helper
|
|||
{
|
||||
SetHotkey(hotkey.Hotkey, (s, e) =>
|
||||
{
|
||||
if (ShouldIgnoreHotkeys()) return;
|
||||
if (ShouldIgnoreHotkeys())
|
||||
return;
|
||||
|
||||
UpdateLastQUeryMode();
|
||||
|
||||
mainViewModel.MainWindowVisibility = Visibility.Visible;
|
||||
mainViewModel.ChangeQueryText(hotkey.ActionKeyword);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue