Make sure back to query results from context menu before changing query

This commit is contained in:
Jack251970 2025-02-12 15:06:15 +08:00
parent e4632926e3
commit ddbbd693e8
5 changed files with 7 additions and 0 deletions

View file

@ -76,6 +76,7 @@ namespace Flow.Launcher
private void BtnTestActionKeyword_OnClick(object sender, RoutedEventArgs e) private void BtnTestActionKeyword_OnClick(object sender, RoutedEventArgs e)
{ {
App.API.BackToQueryResults();
App.API.ChangeQuery(tbAction.Text); App.API.ChangeQuery(tbAction.Text);
Application.Current.MainWindow.Show(); Application.Current.MainWindow.Show();
Application.Current.MainWindow.Opacity = 1; Application.Current.MainWindow.Opacity = 1;

View file

@ -64,6 +64,7 @@ namespace Flow.Launcher
private void BtnTestShortcut_OnClick(object sender, RoutedEventArgs e) private void BtnTestShortcut_OnClick(object sender, RoutedEventArgs e)
{ {
App.API.BackToQueryResults();
App.API.ChangeQuery(tbExpand.Text); App.API.ChangeQuery(tbExpand.Text);
Application.Current.MainWindow.Show(); Application.Current.MainWindow.Show();
Application.Current.MainWindow.Opacity = 1; Application.Current.MainWindow.Opacity = 1;

View file

@ -149,7 +149,10 @@ namespace Flow.Launcher
var rawQuery = query; var rawQuery = query;
var effect = DragDrop.DoDragDrop((DependencyObject)sender, data, DragDropEffects.Move | DragDropEffects.Copy); var effect = DragDrop.DoDragDrop((DependencyObject)sender, data, DragDropEffects.Move | DragDropEffects.Copy);
if (effect == DragDropEffects.Move) if (effect == DragDropEffects.Move)
{
App.API.BackToQueryResults();
App.API.ChangeQuery(rawQuery, true); App.API.ChangeQuery(rawQuery, true);
}
} }
private void ResultListBox_OnPreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e) private void ResultListBox_OnPreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
{ {

View file

@ -64,6 +64,7 @@ namespace Flow.Launcher.ViewModel
private void ShowCommandQuery(string action) private void ShowCommandQuery(string action)
{ {
var actionKeyword = PluginManagerData.Metadata.ActionKeywords.Any() ? PluginManagerData.Metadata.ActionKeywords[0] + " " : String.Empty; var actionKeyword = PluginManagerData.Metadata.ActionKeywords.Any() ? PluginManagerData.Metadata.ActionKeywords[0] + " " : String.Empty;
App.API.BackToQueryResults();
App.API.ChangeQuery($"{actionKeyword}{action} {_plugin.Name}"); App.API.ChangeQuery($"{actionKeyword}{action} {_plugin.Name}");
App.API.ShowMainWindow(); App.API.ShowMainWindow();
} }

View file

@ -146,6 +146,7 @@ namespace Flow.Launcher.ViewModel
[RelayCommand] [RelayCommand]
private void OpenDeletePluginWindow() private void OpenDeletePluginWindow()
{ {
PluginManager.API.BackToQueryResults();
PluginManager.API.ChangeQuery($"{PluginManagerActionKeyword} uninstall {PluginPair.Metadata.Name}".Trim(), true); PluginManager.API.ChangeQuery($"{PluginManagerActionKeyword} uninstall {PluginPair.Metadata.Name}".Trim(), true);
PluginManager.API.ShowMainWindow(); PluginManager.API.ShowMainWindow();
} }