Improve documents & Improve code quality

This commit is contained in:
Jack251970 2025-02-19 17:09:09 +08:00
parent 27d7ef5173
commit 2843236214
8 changed files with 10 additions and 3 deletions

View file

@ -76,6 +76,7 @@ namespace Flow.Launcher
private void BtnTestActionKeyword_OnClick(object sender, RoutedEventArgs e)
{
// if user happens to open context menu, we need to return back to query results before changing query
App.API.BackToQueryResults();
App.API.ChangeQuery(tbAction.Text);
Application.Current.MainWindow.Show();

View file

@ -64,6 +64,7 @@ namespace Flow.Launcher
private void BtnTestShortcut_OnClick(object sender, RoutedEventArgs e)
{
// if user happens to open context menu, we need to return back to query results before changing query
App.API.BackToQueryResults();
App.API.ChangeQuery(tbExpand.Text);
Application.Current.MainWindow.Show();

View file

@ -150,6 +150,7 @@ namespace Flow.Launcher
var effect = DragDrop.DoDragDrop((DependencyObject)sender, data, DragDropEffects.Move | DragDropEffects.Copy);
if (effect == DragDropEffects.Move)
{
// if user happens to open context menu, we need to return back to query results before changing query
App.API.BackToQueryResults();
App.API.ChangeQuery(rawQuery, true);
}

View file

@ -1266,6 +1266,7 @@ namespace Flow.Launcher.ViewModel
{
_topMostRecord.Remove(result);
App.API.ShowMsg(InternationalizationManager.Instance.GetTranslation("success"));
// if user happens to open context menu, we need to return back to query results before changing query
App.API.BackToQueryResults();
App.API.ReQuery();
return false;
@ -1284,6 +1285,7 @@ namespace Flow.Launcher.ViewModel
{
_topMostRecord.AddOrUpdate(result);
App.API.ShowMsg(InternationalizationManager.Instance.GetTranslation("success"));
// if user happens to open context menu, we need to return back to query results before changing query
App.API.BackToQueryResults();
App.API.ReQuery();
return false;

View file

@ -64,6 +64,7 @@ namespace Flow.Launcher.ViewModel
private void ShowCommandQuery(string action)
{
var actionKeyword = PluginManagerData.Metadata.ActionKeywords.Any() ? PluginManagerData.Metadata.ActionKeywords[0] + " " : String.Empty;
// if user happens to open context menu, we need to return back to query results before changing query
App.API.BackToQueryResults();
App.API.ChangeQuery($"{actionKeyword}{action} {_plugin.Name}");
App.API.ShowMainWindow();

View file

@ -146,6 +146,7 @@ namespace Flow.Launcher.ViewModel
[RelayCommand]
private void OpenDeletePluginWindow()
{
// if user happens to open context menu, we need to return back to query results before changing query
PluginManager.API.BackToQueryResults();
PluginManager.API.ChangeQuery($"{PluginManagerActionKeyword} uninstall {PluginPair.Metadata.Name}".Trim(), true);
PluginManager.API.ShowMainWindow();

View file

@ -59,7 +59,6 @@ namespace Flow.Launcher.Plugin.PluginsManager
var link = pluginManifestInfo.UrlSourceCode.StartsWith("https://github.com")
? Regex.Replace(pluginManifestInfo.UrlSourceCode, @"\/tree\/\w+$", "") + "/issues"
: pluginManifestInfo.UrlSourceCode;
Context.API.OpenUrl(link);
return true;
}

View file

@ -5,7 +5,6 @@ using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using WindowsInput;
using WindowsInput.Native;
using Flow.Launcher.Infrastructure.Hotkey;
@ -379,9 +378,11 @@ namespace Flow.Launcher.Plugin.Shell
private void OnWinRPressed()
{
// show the main window and set focus to the query box
Task.Run(() =>
_ = Task.Run(() =>
{
context.API.ShowMainWindow();
// if user happens to open context menu, we need to return back to query results before changing query
context.API.BackToQueryResults();
context.API.ChangeQuery($"{context.CurrentPluginMetadata.ActionKeywords[0]}{Plugin.Query.TermSeparator}");
});