mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #489 from lzl1918/lzl1918/FixShellPluginDoesNotAutoFocus
[Plugin.Shell] Fix: The Query Box Is Not Focused When HotKey Invoked
This commit is contained in:
commit
a312fe8581
2 changed files with 14 additions and 3 deletions
|
|
@ -55,7 +55,7 @@ namespace Flow.Launcher
|
|||
SetHotkey(ctlHotkey.CurrentHotkey, delegate
|
||||
{
|
||||
App.API.ChangeQuery(pluginHotkey.ActionKeyword);
|
||||
Application.Current.MainWindow.Visibility = Visibility.Visible;
|
||||
ShowMainWindow();
|
||||
});
|
||||
}
|
||||
else
|
||||
|
|
@ -73,11 +73,18 @@ namespace Flow.Launcher
|
|||
SetHotkey(new HotkeyModel(updateCustomHotkey.Hotkey), delegate
|
||||
{
|
||||
App.API.ChangeQuery(updateCustomHotkey.ActionKeyword);
|
||||
Application.Current.MainWindow.Visibility = Visibility.Visible;
|
||||
ShowMainWindow();
|
||||
});
|
||||
}
|
||||
|
||||
Close();
|
||||
|
||||
static void ShowMainWindow()
|
||||
{
|
||||
Window mainWindow = Application.Current.MainWindow;
|
||||
mainWindow.Visibility = Visibility.Visible;
|
||||
mainWindow.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateItem(CustomPluginHotkey item)
|
||||
|
|
|
|||
|
|
@ -298,7 +298,11 @@ namespace Flow.Launcher.Plugin.Shell
|
|||
private void OnWinRPressed()
|
||||
{
|
||||
context.API.ChangeQuery($"{context.CurrentPluginMetadata.ActionKeywords[0]}{Plugin.Query.TermSeperater}");
|
||||
Application.Current.MainWindow.Visibility = Visibility.Visible;
|
||||
|
||||
// show the main window and set focus to the query box
|
||||
Window mainWindow = Application.Current.MainWindow;
|
||||
mainWindow.Visibility = Visibility.Visible;
|
||||
mainWindow.Focus();
|
||||
}
|
||||
|
||||
public Control CreateSettingPanel()
|
||||
|
|
|
|||
Loading…
Reference in a new issue